-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
26 lines (22 loc) · 862 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
var express = require('express'),
app = module.exports = express(),
path = require('path'),
routes = require('./routes'),
server = module.exports.server = require('http').Server(app);
// App Configuration
app.set('port', process.env.PORT || 3002);
app.set('views', path.join(__dirname, 'views'));
app.set('node_modules', path.join(__dirname, 'node_modules'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
// Routes
app.get('/', routes.index);
app.get('/positions', routes.positions);
app.get('/css/normalize.css', routes.normalizecss);
app.get('*', routes.fileNotFound); // 404 page should always be last
// Events
var events = require('./events');
// Start server listening
server.listen(app.get('port'), function () {
console.log('Server listening on port ' + this.address().port);
});