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) {
|
2022-01-09 20:51:50 +01: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);
|
|
|
|
|
2022-01-09 20:51:50 +01:00
|
|
|
return next({ ok: message });
|
2017-10-24 16:02:08 +02:00
|
|
|
});
|
2019-09-26 18:22:14 +02:00
|
|
|
};
|
2018-06-22 20:54:14 +02:00
|
|
|
|
|
|
|
module.exports = Plugin;
|