-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (23 loc) · 939 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
30
var express = require('express'),
path = require('path'),
routes = require('./routes/index');
var app = express();
app.set('port', process.env.PORT || 3000);
app.set('view engine', 'pug');
app.use('/js', express.static(path.join(__dirname, 'js')));
app.use('/docs', express.static(path.join(__dirname, 'docs')));
app.use('/assets', express.static(path.join(__dirname, 'docs/assets')));
app.use('/css', express.static(path.join(__dirname, 'css')));
app.use('/images', express.static(path.join(__dirname, 'images')));
app.use('/vendor', express.static(path.join(__dirname, 'vendor')));
app.use('/', routes);
app.use(function(req, res, next) {
res.status(404).send("Sorry can't find that!");
});
app.use(function(err, req, res, next) {
console.error(err.stack);
res.status(500).send('Something broke!');
});
app.listen(app.get('port'), function() {
console.log('MN Election Night is running on port', app.get('port'));
});