-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserver.js
36 lines (25 loc) · 860 Bytes
/
server.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
'use-strict';
const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
const _ = require('underscore');
const config = require('./config/get-config')
const path = require('path');
const userAuthRoute = require('./routes/user-auth')
const bodyParser = require('body-parser')
const morgan = require('morgan')
app.get('/', function(req, res, next) {
res.sendFile(__dirname + '/public/index.html')
});
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json({limit: '50mb'}))
app.use(bodyParser.urlencoded({extended: true, limit: '50mb'}))
//Routes
app.use('/api/users', userAuthRoute);
//Events
io.on('connection', function(client) {
});
server.listen(config.port, function () {
console.log('Listening on port ' + config.port)
})