-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (23 loc) · 855 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
var express = require('express');
global.app = express();
global.moment = require('moment');
const expressValidator = require('express-validator');
const cors = require('cors');
const bodyParser = require('body-parser');
const http = require('http');
global.nodeSiteUrl = 'http://demo.com:8080'; // node
var path = require('path');
app.use(function (req, res, next) {
res.header('Content-Type', 'application/json');
next();
});
app.use(bodyParser.json());
app.use(express.urlencoded({limit: '100mb',extended: true }));
var indexRouter = require('./routes/index');
app.use('/', indexRouter);
var server = app.listen(8080, function () {
console.log("Example app listening at http://demo.com:%s", 8080);
});
process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
});