summaryrefslogtreecommitdiff
path: root/app.js
blob: 83318c67f0eb2466f48e0748062bce4dbe41a85b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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);