-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
24 lines (20 loc) · 801 Bytes
/
Copy pathserver.js
File metadata and controls
24 lines (20 loc) · 801 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
(function () {
'use strict';
/**
* Create an instance of the app, and pass it to the app bootstrap.
*/
var express = require('express'),
config = require('./config/app'),
database = require('./config/database'),
mongoose = require('mongoose'),
app = express();
mongoose.connect('mongodb://' + database["host"] + (database["port"] ? ':' + database["port"] : '') + '/' + database["db"]);
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function () {
require("./source/bootstrap")(app);
var listener = app.listen(config['port'] || 5000, function () {
console.log('Listening on port ' + listener.address().port);
});
});
})();