mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
15d9a77092
* moved `server/config` to `shared/config` * updated config import paths in server to use shared * updated config import paths in frontend to use shared * updated config import paths in test to use shared * updated config import paths in root to use shared * trigger regression tests * of course the rebase broke tests
20 lines
638 B
JavaScript
20 lines
638 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?
|
|
const slashes = require('connect-slashes');
|
|
const config = require('../../../../shared/config');
|
|
|
|
module.exports = [
|
|
slashes(true, {
|
|
headers: {
|
|
'Cache-Control': `public, max-age=${config.get('caching:301:maxAge')}`
|
|
}
|
|
}),
|
|
require('./uncapitalise')
|
|
];
|