-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (30 loc) · 917 Bytes
/
index.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
37
38
39
40
41
42
43
44
'use strict';
var kraken = require('kraken-js'),
db = require('./lib/database'),
language = require('./lib/language'),
express = require('express'),
app = {};
app.configure = function configure(nconf, next) {
// Async method run on startup.
db.config(nconf.get('databaseConfig'));
next(null);
};
app.requestStart = function requestStart(server) {
// Run before most express middleware has been registered.
};
app.requestBeforeRoute = function requestBeforeRoute(server) {
// Run before any routes have been added.
server.use(language());
server.use(express.methodOverride());
};
app.requestAfterRoute = function requestAfterRoute(server) {
// Run after all routes have been added.
};
if (require.main === module) {
kraken.create(app).listen(function (err) {
if (err) {
console.error(err);
}
});
}
module.exports = app;