-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
39 lines (33 loc) · 1.22 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
const express = require('express');
const methodOverride = require('method-override');
const path = require('path');
const logger = require('morgan');
const bodyParser = require('body-parser');
const expressFileupload = require('express-fileupload');
const session = require('express-session');
var app = express();
const PORT = process.env.PORT || 3000;
global.rootURL = "";
/***************** Neo4j DB configuration *****************/
var db = require('./config/db');
/******************* Express App Setup ********************/
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(methodOverride('_method'));
app.use(expressFileupload());
app.use(session({
secret: 'kupk07',
resave: false,
saveUninitialized: true,
rolling: true,
cookie: {secure: false}
}));
/******************* View Engine Setup ********************/
app.use(express.static(path.join(__dirname, 'public')));
app.set('views', path.join(__dirname, 'app', 'views'));
app.set('view engine', 'ejs');
/************************* Routes *************************/
var router = require('./config/routes/routes');
app.use(router);
app.listen(PORT, () => console.log(`App is listening on port ${PORT}!`));