-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
27 lines (20 loc) · 775 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
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', 'jade');
app.use('/public', express.static(path.join(__dirname, 'public')));
app.use('/partials', express.static(path.join(__dirname, 'views/partials')));
app.use('/node_modules', express.static(path.join(__dirname, 'node_modules')));
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('Days Without Destiny is running on port', app.get('port'));
});