mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
a1a70c973f
add es6 transpiled use case
54 lines
830 B
JavaScript
54 lines
830 B
JavaScript
/**
|
|
* Original plugin in ES6
|
|
*
|
|
* class PluginES6 {
|
|
|
|
constructor (config, stuff) {
|
|
this._config = config;
|
|
}
|
|
|
|
register_middlewares(app, auth, storage) {
|
|
const {message} = this._config;
|
|
|
|
app.get('/test/route/es6', function (req, res, next) {
|
|
res.status(200);
|
|
|
|
return next({ok: message})
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
export default PluginES6;
|
|
|
|
*/
|
|
|
|
// this file has been transpiled with babel.js
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
class PluginES6 {
|
|
|
|
constructor(config, stuff) {
|
|
this._config = config;
|
|
}
|
|
|
|
register_middlewares(app, auth, storage) {
|
|
const message = this._config.message;
|
|
|
|
|
|
app.get('/test/route/es6', function (req, res, next) {
|
|
res.status(200);
|
|
|
|
return next({ ok: message });
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = PluginES6;
|
|
|