-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
41 lines (32 loc) · 1.01 KB
/
app.js
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
const express = require('express');
const bodyParser = require('body-parser');
const session = require('express-session');
const port = process.env.PORT || 3000;
const routerIndex = require('./routes/index');
const routerMenu = require('./routes/menu');
const routerPesanan = require('./routes/pesanan');
const routerKasir = require('./routes/kasir');
const routerDapur = require('./routes/dapur');
const checkLogin = require('./helpers/checkLogin');
const app = express();
app.locals.helper = require('./helpers/helpers.js');
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(session({
secret: "makanyukpos",
resave: false,
saveUninitialized: true,
cookie: { secure: false }
}));
app.use(express.static('public'));
// ROUTES
app.use('/', routerIndex);
app.use('/menus', routerMenu);
app.use('/pesanan', routerPesanan);
app.use('/kasir', routerKasir);
app.use('/dapur', routerDapur);
app.listen(port, function(err){
console.log('Aplikasi berjalan di '+port)
})