-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappConfig.js
29 lines (21 loc) · 1008 Bytes
/
appConfig.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
require('app-module-path').addPath(__dirname + '/lib');
exports.setup = function(runningApp, callback) {
// Nothing ever comes from "x-powered-by", but a security hole
runningApp.disable("x-powered-by");
// Choose your favorite view engine(s)
runningApp.set('view engine', 'handlebars');
runningApp.engine('handlebars', require('hbs').__express);
//// you could use two view engines in parallel (if you are brave):
// runningApp.set('view engine', 'j2');
// runningApp.engine('j2', require('swig').renderFile);
//---- Mounting well-encapsulated application modules (so-called: "mini-apps")
//---- See: http://expressjs.com/guide/routing.html and http://vimeo.com/56166857
// API endpoint attached to root route:
runningApp.use('/', require('homedoc')); // attach to root route
// If you need websockets:
// var socketio = require('socket.io')(runningApp.http);
// require('fauxchatapp')(socketio);
if(typeof callback === 'function') {
callback(runningApp);
}
};