-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
40 lines (22 loc) · 784 Bytes
/
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
//import
const express = require('express');
const bodyParser = require('body-parser'); // body parser
const path = require('path');
const router = require('./Routes/route')
const rout_login = require('./Routes/login_route')
const app = express();
global.currentUser = "";
//set uo templating engine
app.set('view engine','ejs'); // to let express know what templating engine we're using
app.set('views', 'views'); //where to find the templates
//set up body parser
app.use(bodyParser.urlencoded({extended: false}));
//set up body parser
app.use(express.static(path.join(__dirname,'public'))); // CSS
if (!currentUser) {
console.log("No user")
// app.use(rout_login.routes);
}
app.use(router.routes);
exports.currentUser = currentUser;
app.listen(3000);