2019-09-26 18:22:14 +02:00
|
|
|
function Plugin(config, pluginOptions) {
|
2018-06-22 20:54:14 +02:00
|
|
|
const self = Object.create(Plugin.prototype);
|
|
|
|
|
|
|
|
self._config = config;
|
2019-09-26 18:22:14 +02:00
|
|
|
self._logger = pluginOptions.logger;
|
2018-06-22 20:54:14 +02:00
|
|
|
return self;
|
2017-10-24 16:02:08 +02:00
|
|
|
}
|
|
|
|
|
2019-09-26 18:22:14 +02:00
|
|
|
Plugin.prototype.register_middlewares = function (app) {
|
2017-10-24 16:02:08 +02:00
|
|
|
|
2018-06-22 20:54:14 +02:00
|
|
|
const {message} = this._config;
|
2017-10-24 16:02:08 +02:00
|
|
|
app.get('/test/route', function (req, res, next) {
|
2018-06-22 20:54:14 +02:00
|
|
|
res.status(200);
|
|
|
|
|
2017-10-24 16:02:08 +02:00
|
|
|
return next({ ok: message })
|
|
|
|
});
|
2019-09-26 18:22:14 +02:00
|
|
|
};
|
2018-06-22 20:54:14 +02:00
|
|
|
|
|
|
|
module.exports = Plugin;
|