mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
839eb5bd43
refs #9589 - use const, let, arrow function, string template
22 lines
654 B
JavaScript
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();
|
|
});
|
|
}
|
|
};
|