added post redirects

This commit is contained in:
mrfry 2023-04-02 13:20:15 +02:00
parent 182f003a65
commit 0f6b4050df
3 changed files with 50 additions and 7 deletions

View file

@ -186,6 +186,11 @@ function GetApp(): ModuleType {
from: '/patreon',
to: links.patreon,
},
// -----------------------------------
{
from: '/hasNewMsgs',
to: 'api/hasNewMsgs',
},
]
simpleRedirects.forEach((redirect) => {
@ -208,6 +213,17 @@ function GetApp(): ModuleType {
})
})
const postRedirects = [
{ from: '/ask', to: '/api/ask' },
{ from: '/isAdding', to: '/api/isAdding' },
]
postRedirects.forEach((redirect) => {
app.post(redirect.from, function (_req: Request, res) {
res.redirect(307, redirect.to)
})
})
// --------------------------------------------------------------
function AddHtmlRoutes(files: string[]) {