diff options
author | Rafael Marçalo <rafael.marcalo@cast.pt> | 2022-10-21 02:00:10 +0100 |
---|---|---|
committer | Rafael Marçalo <rafael.marcalo@cast.pt> | 2022-10-21 02:00:10 +0100 |
commit | dad891f9d7f060c5d2f4c9f47c410730aa48d5df (patch) | |
tree | 8d9bca113b426bb2dd6d5b9884a3ed6e84202f79 /app.js |
Added initially developed files
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +"use strict"; + +// handling imports +const express = require('express'); +const bodyParser = require('body-parser'); +const app = express(); +const PORT = 8080; + +// set the public folder to public acess and added a body parser +app.use(express.static('public')); +app.use(bodyParser.urlencoded({extended: true})); + +// set the view engine to ejs +app.set('view engine', 'ejs'); + +// routes management +const home = require("./routes/home"); +const info = require("./routes/info"); +const search = require("./routes/search"); +const settings = require("./routes/settings"); + +app.get('/', home); +app.get('/info', info); +app.get('/settings', settings); +app.post('/search', search); + +// app start +app.listen(PORT); +console.log('Server is listening on port ' + PORT);
\ No newline at end of file |