-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (35 loc) · 936 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
39
40
41
/**
* Constnats
*/
const port = 3000;
/**
* Modules
*/
var express = require('express');
var path = require('path');
var app = express();
var server = require('http').Server(app);
var bodyParser = require('body-parser');
/**
* Server Configurations
*/
app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
app.use(express.static(__dirname + '/public'));
app.use('/core', express.static(__dirname + '/app'));
app.use('/scripts', express.static(__dirname + '/node_modules'));
app.get('/', function (req, res) {
res.sendFile(__dirname + '/public/index.html');
});
/**
* Exports
*/
var session = require('./server/session')(app);
var routes = require('./server/routes')(app);
var socketIO = require('./server/socket-io')(server);
/**
* Server initialization
*/
server.listen(port, function(){
console.log('app start: ' + port);
});