forked from jpotts18/mean-stack-relational
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
executable file
·34 lines (26 loc) · 895 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
/**
* Module dependencies.
*/
var express = require('express');
var fs = require('fs');
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
// Load Configurations
var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var config = require('./config/config');
var auth = require('./config/middlewares/authorization');
var db = require('./config/sequelize');
var passport = require('./config/passport');
var app = express();
//Initialize Express
require('./config/express')(app, passport);
//Initialize Routes
require('./config/routes').init(app, passport, auth);
//Start the app by listening on <port>
var port = process.env.PORT || config.port;
app.listen(port);
console.log('Express app started on port ' + port);
//expose app
exports = module.exports = app;