mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-11 22:13:20 +03:00
4a6f58d8d1
refs #8140 ✨ Support new default-prod.hbs template for admin ✨ Redirect ghost admin urls without a # ✨ Update admin urls to include # 🎨 Move the admin templates 🔥 Remove redirect to setup middleware 🚨 Tests for new middleware
15 lines
337 B
JavaScript
15 lines
337 B
JavaScript
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
|
|
];
|