-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (28 loc) · 809 Bytes
/
index.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
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(express.static('public'));
app.engine('ejs', require('ejs').renderFile);
app.set('view engine', 'ejs');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/', function(req,res,next){
res.tlp = {};
return next();
});
/**
* Include all the routes
*/
require('./route/graph')(app);
require('./route/vertex')(app);
require('./route/edge')(app);
require('./route/outside')(app);
/**
* Standard error handler
*/
app.use(function (err, req, res, next) {
res.status(500).send('Houston, we have a problem!');
//Flush out the stack to the console
console.error(err.stack);
});
var server = app.listen(3000, function(){console.log("3000")});