-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (32 loc) · 1.03 KB
/
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
'use strict';
var express = require('express');
var kraken = require('kraken-js');
var flash = require('connect-flash');
var db = require('./lib/db');
var options, app;
/*
* Create and configure application. Also exports application instance for use by tests.
* See https://github.com/krakenjs/kraken-js#options for additional configuration options.
*/
options = {
onconfig: function (config, next) {
/*
* Add any additional config setup or overrides here. `config` is an initialized
* `confit` (https://github.com/krakenjs/confit/) configuration object.
*/
db.config(config.get('databaseConfig'));
next(null, config);
}
};
app = module.exports = express();
app.use(kraken(options));
// Connect-Flash
app.use(flash());
app.use(function(req,res,next){
res.locals.messages = require('express-messages')(req,res);
next();
});
app.on('start', function () {
console.log('Application ready to serve requests.');
console.log('Environment: %s', app.kraken.get('env:env'));
});