192ebb1739
refs #9178 - move tests as well
23 lines
647 B
JavaScript
23 lines
647 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
|
|
// Dirty requires
|
|
config = require('../../config'),
|
|
settingsCache = require('../../services/settings/cache');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
var ampRoute = '*/' + config.get('routeKeywords').amp + '/';
|
|
|
|
ghost.routeService.registerRouter(ampRoute, function settingsEnabledRouter(req, res, next) {
|
|
if (settingsCache.get('amp') === true) {
|
|
return router.apply(this, arguments);
|
|
}
|
|
|
|
next();
|
|
});
|
|
|
|
registerHelpers(ghost);
|
|
}
|
|
};
|