reload config on each poll
This commit is contained in:
parent
d5c69079d5
commit
7f14fb3adc
3 changed files with 19 additions and 5 deletions
12
lib/app.js
12
lib/app.js
|
|
@ -46,6 +46,17 @@ module.exports = function(options) {
|
|||
|
||||
app.use(express.bodyParser());
|
||||
|
||||
var reloadConfigMiddleware = function(req, res, next) {
|
||||
lamassuConfig.load(function(err, config) {
|
||||
if (err) {
|
||||
logger.error('Error while reloading config');
|
||||
return next(err)
|
||||
}
|
||||
plugins.configure(config);
|
||||
next();
|
||||
});
|
||||
};
|
||||
|
||||
var authMiddleware;
|
||||
|
||||
if (options.https) {
|
||||
|
|
@ -91,6 +102,7 @@ module.exports = function(options) {
|
|||
lamassuConfig: lamassuConfig,
|
||||
plugins: plugins,
|
||||
authMiddleware: authMiddleware,
|
||||
reloadConfigMiddleware: reloadConfigMiddleware,
|
||||
mock: options.mock
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue