-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (26 loc) · 953 Bytes
/
index.js
File metadata and controls
38 lines (26 loc) · 953 Bytes
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 path = require('path');
var express = require('express');
var app = express();
const server = require('http').Server(app);
require('./socket/socketio')(server);
const bodyParser = require('body-parser');
const cors = require('cors');
app.use(bodyParser.json());
app.use(cors());
app.get("/", function (req, res) {
res.sendFile(__dirname + "/public/views/index.html");
});
var port = 4500;
server.listen(port, function () {
console.log(`App listening on port ${port}!`)
})
process
.on('unhandledRejection', function onError(err) {
console.log(`An unhandled rejection of promose, more details in error log.`);
console.log(`Unhandled Rejection at Promise with error: ${err} Stacktrace: ${err.stack}`);
})
.on('uncaughtException', err => {
console.log(`An uncaught Exception thrown, more details in error log.`);
console.log(`Uncaught Exception thrown: ${err} Stacktrace: ${err.stack}`);
process.exit(1);
});