mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added post redirects
This commit is contained in:
@@ -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[]) {
|
||||
|
Reference in New Issue
Block a user