-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·35 lines (27 loc) · 888 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
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
/**
* Load dependencies
* ====================================================
*/
var express = require('express');
/**
* Setup global basic configuration
* ====================================================
*/
global.cf = require('./config/config');
global.md = require('./config/middlewares');
global.db = require('./config/sequelize');
global.utils = require('./config/utils');
var seeds = require('./config/seeds');
var passport = require('./config/passport');
var app = express();
// load express configuration
require('./config/express')(app, passport);
require('./config/routes').init(app);
require('./config/errors')(app);
app.set('port', process.env.PORT || global.cf.port);
global.db.sequelize.sync({force: true}).then(function () {
seeds.start().then(function () {
global.lift(app);
});
});