mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
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);
|
|
}
|
|
};
|