-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (21 loc) · 672 Bytes
/
app.js
File metadata and controls
29 lines (21 loc) · 672 Bytes
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
var express = require('express');
var handlebars = require('express-handlebars');
var bodyParser = require('body-parser');
var app = express();
var routes = require('./lib/routes');
// view engine setup
app.engine('.hbs', handlebars({
defaultLayout: 'default',
extname: '.hbs'
}));
app.set('view engine', '.hbs');
// uncomment after placing your favicon in /public
app.use(bodyParser.urlencoded({ extended: false }));
routes.mountAllRoutes(app);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found! (no route mapped to this URL)');
err.status = 404;
next(err);
});
module.exports = app;