-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
27 lines (22 loc) · 697 Bytes
/
start.js
File metadata and controls
27 lines (22 loc) · 697 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
var express = require('express');
var http = require('http');
var mongoose = require('mongoose');
var include = require("includemvc");
var app = include.app();
var config = app.config;
var server = http.createServer(app);
//if(config.enableIO) {
// var io = include.lib("socket")(server);
//}
mongoose.connect(config.mongodburi);
/**
* Load all components enabled in config.components
* The component must have an index.js present
*/
var components = config.components;
components.forEach(function(component) {
app.use(require("./components/" + component));
});
server.listen(app.get('port'), function(){
console.log('Express.js MVC server listening on port ' + app.get('port'));
});