mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 07:51:55 +03:00
192ebb1739
refs #9178 - move tests as well
23 lines
709 B
JavaScript
23 lines
709 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
|
|
// Dirty requires
|
|
config = require('../../config'),
|
|
labs = require('../../services/labs');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
var subscribeRoute = '/' + config.get('routeKeywords').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') === true) {
|
|
return router.apply(this, arguments);
|
|
}
|
|
|
|
next();
|
|
});
|
|
}
|
|
};
|