-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
41 lines (29 loc) · 905 Bytes
/
server.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
'use strict';
/**
* Mean container for dependency injection
*/
var mean = require('meanio');
mean.app('Mean Demo App',{});
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
passport = require('passport'),
logger = require('mean-logger'),
express = require('express');
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
// Initializing system variables
var config = require('./server/config/config');
var db = mongoose.connect(config.db);
// Bootstrap Models, Dependencies, Routes and the app as an express app
var app = require('./server/config/system/bootstrap')(passport, db);
// Start the app by listening on <port>
app.listen(config.port);
console.log('HTTP redirect app started on port ' + config.port);
// Initializing logger
logger.init(app, passport, mongoose);
// Expose app
exports = module.exports = app;