2016-10-04 20:09:18 +03:00
|
|
|
var router = require('./lib/router'),
|
|
|
|
registerHelpers = require('./lib/helpers'),
|
2016-04-14 20:33:22 +03:00
|
|
|
|
2016-04-21 18:37:52 +03:00
|
|
|
// Dirty requires
|
2016-10-04 20:09:18 +03:00
|
|
|
config = require('../../config'),
|
|
|
|
labs = require('../../utils/labs');
|
2016-04-14 20:33:22 +03:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
activate: function activate(ghost) {
|
2016-10-04 20:09:18 +03:00
|
|
|
registerHelpers(ghost);
|
2016-04-14 20:33:22 +03:00
|
|
|
},
|
|
|
|
|
2017-10-26 19:24:08 +03:00
|
|
|
setupRoutes: function setupRoutes(siteRouter) {
|
|
|
|
siteRouter.use('/' + config.get('routeKeywords').subscribe + '/', function labsEnabledRouter(req, res, next) {
|
2016-04-21 18:37:52 +03:00
|
|
|
if (labs.isSet('subscribers') === true) {
|
|
|
|
return router.apply(this, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
next();
|
|
|
|
});
|
2016-04-14 20:33:22 +03:00
|
|
|
}
|
|
|
|
};
|