Ghost/core/server/apps/subscribers/index.js
Tien Do 839eb5bd43 ES6 migration: server/apps/subscribers (#9688)
refs #9589

- use const, let, arrow function, string template
2018-09-10 11:06:41 +02:00

22 lines
654 B
JavaScript

const router = require('./lib/router'),
registerHelpers = require('./lib/helpers'),
// Dirty requires
labs = require('../../services/labs');
module.exports = {
activate(ghost) {
// routeKeywords.subscribe: 'subscribe'
const subscribeRoute = '/subscribe/';
// TODO, how to do all this only if the Subscribers flag is set?!
registerHelpers(ghost);
ghost.routeService.registerRouter(subscribeRoute, function labsEnabledRouter(req, res, next) {
if (labs.isSet('subscribers')) {
return router.apply(this, arguments);
}
next();
});
}
};