mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
474e9234a6
refs #9192 - The AMP app is nothing more than a custom controller - this will come clear soon - Moved enabled/disabled logic into router - Removed error-related code, as this wasn't used - Changed logic for static pages to be based on req.body, not context - Improved the tests to match
21 lines
604 B
JavaScript
21 lines
604 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
|
|
// Dirty requires
|
|
config = require('../../config'),
|
|
settingsCache = require('../../settings/cache');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
registerHelpers(ghost);
|
|
|
|
ghost.routeService.registerRouter('*/' + config.get('routeKeywords').amp + '/', function settingsEnabledRouter(req, res, next) {
|
|
if (settingsCache.get('amp') === true) {
|
|
return router.apply(this, arguments);
|
|
}
|
|
|
|
next();
|
|
});
|
|
}
|
|
};
|