add local server and reboot functionality

This commit is contained in:
Josh Harvey 2016-03-17 02:01:13 +02:00
parent bd9cd4f0e9
commit 593bcd6ed0
3 changed files with 129 additions and 4 deletions

View file

@ -54,9 +54,9 @@ module.exports = function(options) {
}
plugins.configure(config);
next();
});
});
};
var authMiddleware;
if (options.https) {
@ -97,8 +97,14 @@ module.exports = function(options) {
if (options.mock) logger.info('In mock mode');
var localApp = express()
localApp.use(express.bodyParser())
var localServer = http.createServer(localApp)
var localPort = 7070
routes.init({
app: app,
localApp: localApp,
lamassuConfig: lamassuConfig,
plugins: plugins,
authMiddleware: authMiddleware,
@ -106,5 +112,9 @@ module.exports = function(options) {
mock: options.mock
});
localServer.listen(7070, function () {
console.log('lamassu-server is listening on local port %d', localPort)
})
return server;
};