add local server and reboot functionality
This commit is contained in:
parent
bd9cd4f0e9
commit
593bcd6ed0
3 changed files with 129 additions and 4 deletions
14
lib/app.js
14
lib/app.js
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue