mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 13:31:39 +03:00
7bcccc71dc
refs #9178 - move express apps to one place (called `web`) - requires https://github.com/TryGhost/Ghost-Admin/pull/923 - any further improvements are not part of this PR - this PR just moves the files and ensures the paths are up-to-date
20 lines
621 B
JavaScript
20 lines
621 B
JavaScript
// Pretty URL redirects
|
|
//
|
|
// These are two pieces of middleware that handle ensuring that
|
|
// URLs get formatted correctly.
|
|
// Slashes ensures that we get trailing slashes
|
|
// Uncapitalise changes case to lowercase
|
|
// @TODO optimise this to reduce the number of redirects required to get to a pretty URL
|
|
// @TODO move this to being used by routers?
|
|
var slashes = require('connect-slashes'),
|
|
config = require('../../config');
|
|
|
|
module.exports = [
|
|
slashes(true, {
|
|
headers: {
|
|
'Cache-Control': 'public, max-age=' + config.get('caching:301:maxAge')
|
|
}
|
|
}),
|
|
require('./uncapitalise')
|
|
];
|