0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/functional/fixtures/plugins/middlewares.js
Håkan Canberger 374a5e8e7b feat: Add middleware plugins from fl4re/sinopia
This is basically the PR fl4re/sinopia#18 by @fredr
2017-11-01 15:01:25 +01:00

17 lines
369 B
JavaScript

module.exports = Plugin
function Plugin(config, stuff) {
var self = Object.create(Plugin.prototype)
self._config = config
return self
}
Plugin.prototype.register_middlewares = function (app, auth, storage) {
var message = this._config.message
app.get('/test/route', function (req, res, next) {
res.status(200)
return next({ ok: message })
});
}