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:
parent
182f003a65
commit
0f6b4050df
3 changed files with 50 additions and 7 deletions
|
@ -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[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue