0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/admin/middleware.js

15 lines
337 B
JavaScript
Raw Normal View History

var utils = require('../utils');
function redirectAdminUrls(req, res, next) {
var ghostPathMatch = req.originalUrl.match(/^\/ghost\/(.+)$/);
if (ghostPathMatch) {
return res.redirect(utils.url.urlJoin(utils.url.urlFor('admin'), '#', ghostPathMatch[1]));
}
next();
}
module.exports = [
redirectAdminUrls
];