-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
50 lines (44 loc) · 1.08 KB
/
app.js
File metadata and controls
50 lines (44 loc) · 1.08 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const expressLayouts = require('express-ejs-layouts');
require('dotenv').config();
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }));
app.use(expressLayouts);
app.set('view engine', 'ejs');
app.set('views', 'views')
app.set('layout', './master')
app.use((req, res, next) => {
res.locals.masterMenu = {
headerMenu: [
{
label: 'home',
link: '/',
},
{
label: 'datnq',
link: 'https://nqdat.com'
},
{
label: 'newnet',
link: 'https://newnet.vn',
},
],
footerMenu: [
{
label: 'home',
link: '/',
},
{
label: 'datnq',
link: 'https://nqdat.com'
},
]
};
next();
})
require("./routes/router")(app);
app.listen(process.env.PORT, function() {
console.log('server running: http://localhost:' + process.env.PORT);
});