Added redirect logic

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2022-07-05 05:41:52 +01:00
parent db94ace86e
commit 1b2e0d7501
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78
2 changed files with 11 additions and 0 deletions

3
app.js
View File

@ -30,6 +30,9 @@ app.use(express.static(__dirname + '/build'));
// Lets try and slow down some of those exploit crawlers // Lets try and slow down some of those exploit crawlers
app.use("/", require('./filterRoutes')); app.use("/", require('./filterRoutes'));
// Redirects
app.use("/", require('./redirects'));
// Handle some iOS icon 404s // Handle some iOS icon 404s
app.get("/apple-touch-icon*", function(req, res) { app.get("/apple-touch-icon*", function(req, res) {
res.sendFile(__dirname + '/build/images/favico/' + req.url, () => { res.sendFile(__dirname + '/build/images/favico/' + req.url, () => {

8
redirects.js Normal file
View File

@ -0,0 +1,8 @@
const express = require('express');
const router = express.Router();
router.get('2022-07-04-managing-kubernetes-without-loosing-your-cool', function(req, res) {
return res.redirect("/2022-07-04-managing-kubernetes-without-losing-your-cool/")
});
module.exports = router