forked from Elizavetta/node-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
36 lines (24 loc) · 779 Bytes
/
app.js
File metadata and controls
36 lines (24 loc) · 779 Bytes
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';
/**
* Module dependencies.
*/
var log = require('winston-wrapper')(module);
var config = require('nconf');
var express = require('express');
var bootable = require('bootable');
// End of Dependencies
var app = bootable(express());
// Setup initializers
app.phase(bootable.initializers('setup/initializers'));
// Setup params
app.phase(bootable.initializers('params'));
// Setup environments
app.phase(require('bootable-environment')('setup/environments', app));
// Setup routes
app.phase(bootable.routes('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'));
});
});