-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (26 loc) · 868 Bytes
/
index.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
'use strict';
var consign = require('consign');
var express = require('express');
var config = require('config');
var ws = require('socket.io');
var bodyParser = require('body-parser');
var app = express();
var htPort = config.get('htPort');
var wsPort = config.get('wsPort');
// Parse JSON data in post requests
app.use(bodyParser.json());
app.ws = ws(wsPort);
app.authenticate = require('./app/authenticate').auth;
consign({cwd: 'app'})
.include('auth')
.include('controllers')
.include('routes')
.into(app);
var server = app.listen(htPort, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Mission-Control listening at http://%s:%s', host, port);
// Service discovery and registration
require('carbono-service-manager');
});
module.exports = server;