-
Notifications
You must be signed in to change notification settings - Fork 26
/
app.js
42 lines (28 loc) · 933 Bytes
/
app.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
'use strict';
/**
* Module dependencies.
*/
var log = require('./lib/utils').log(module, 'You are Welcome!');
var config = require('./lib/utils').config;
var express = require('express');
var loggerMw = require('./middlewares/express-logger');
var requireTree = require('require-tree');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var bootable = require('bootable');
var app = bootable(express());
app.phase(bootable.initializers('./setup/initializers'));
app.phase(function(){
log.info('Setup Environment');
require('./setup/environments/').all(app);
});
app.phase(function(){
log.info('Setup Routes');
require('./routes')(app);
});
app.boot(function(err) {
if (err) { throw err; }
app.listen(config.get('express:port'), function() {
log.info('Express listen port', config.get('express:port'));
});
});