-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (23 loc) · 944 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
/**
* Created by kchistyak on 16.10.2014.
*/
var express = require('express'),
app = express(),
path = require('path'),
socketServer = require('./lib/interface'),
config = require('./lib/config'),
bodyParser = require('body-parser'),
controller = require('./lib/controller');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
var httpServer = app.listen(config.port, function (){
console.log('Listening on port ' + config.port);
});
socketServer.run(httpServer);
app.use('/css', express.static(__dirname + '/app/css'));
app.use('/bower_components', express.static(__dirname + '/bower_components'));
app.use('/node_modules', express.static(__dirname + '/node_modules'));
app.use('/scripts', express.static(__dirname + '/app/scripts'));
app.use('/views', express.static(__dirname + '/app/views'));
app.use('/images', express.static(__dirname + '/app/images'));
controller(app);