-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.js
36 lines (31 loc) · 1.11 KB
/
configure.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
31
32
33
34
35
36
'use strict';
//dependency
var engines = require('consolidate')
, express = require('express')
, path = require('path')
, methods = require('methods')
, errorHandlers = require('./libs/errorHandlers.js');
module.exports = function(app){
//configure for all env
app.configure(function () {
//use dust as template engine
app.engine('dust', engines.dust);
//set template location to './views'
app.set('views', __dirname + '/views/');
app.set('view engine', 'dust');
//view cache Enables view template compilation caching, enabled only in production by default
//app.set('view cache', true);
app.use(express.favicon());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.logger('short'));
//TO-DO set your application secret
app.use(express.cookieParser('your secret here'));
app.use(express.responseTime());
app.use(app.router);
//Enable this if you wish to use expressjs to host your js/css/img.
//app.use(express.static(__dirname + '/public'));
});
//bind errors with error handlers
errorHandlers(app);
}