forked from linnovate/mean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
executable file
·35 lines (28 loc) · 860 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
'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');
/**
* 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('Express app started on port ' + config.port);
// Initializing logger
logger.init(app, passport, mongoose);
// Expose app
exports = module.exports = app;