mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
redirect fixes
This commit is contained in:
parent
57aea151f4
commit
182f003a65
1 changed files with 7 additions and 13 deletions
|
@ -35,6 +35,7 @@ import { LinksSchema, validateJSON } from '../../types/typeSchemas'
|
|||
let publicdirs: string[] = []
|
||||
let userDB: Database
|
||||
let nextdir = ''
|
||||
let domain = ''
|
||||
|
||||
function GetApp(): ModuleType {
|
||||
app.use(
|
||||
|
@ -119,18 +120,14 @@ function GetApp(): ModuleType {
|
|||
app.get('/ask', function (req: Request, res) {
|
||||
logger.DebugLog(`Qmining module ask redirect`, 'ask', 1)
|
||||
res.redirect(
|
||||
`http://api.frylabs.net/ask?q=${req.query.q}&subj=${req.query.subj}&data=${req.query.data}`
|
||||
`http://${domain}/ask?q=${req.query.q}&subj=${req.query.subj}&data=${req.query.data}`
|
||||
)
|
||||
})
|
||||
|
||||
const simpleRedirects = [
|
||||
{
|
||||
from: '/dataeditor',
|
||||
to: 'https://dataeditor.frylabs.net',
|
||||
},
|
||||
{
|
||||
from: '/install',
|
||||
to: 'https://qmining.frylabs.net/moodle-test-userscript/stable.user.js',
|
||||
to: `https://${domain}/moodle-test-userscript/stable.user.js`,
|
||||
},
|
||||
{
|
||||
from: '/servergit',
|
||||
|
@ -148,10 +145,6 @@ function GetApp(): ModuleType {
|
|||
from: '/classesgit',
|
||||
to: 'https://gitlab.com/MrFry/question-classes',
|
||||
},
|
||||
{
|
||||
from: '/addQuestion',
|
||||
to: 'https://dataeditor.frylabs.net',
|
||||
},
|
||||
{
|
||||
from: '/donate',
|
||||
to: links.donate,
|
||||
|
@ -174,15 +167,15 @@ function GetApp(): ModuleType {
|
|||
},
|
||||
{
|
||||
from: '/allqr',
|
||||
to: 'https://api.frylabs.net/allqr.txt',
|
||||
to: `https://${domain}/api/allqr.txt`,
|
||||
},
|
||||
{
|
||||
from: '/allqr.txt',
|
||||
to: 'https://api.frylabs.net/allqr.txt',
|
||||
to: `https://${domain}/api/allqr.txt`,
|
||||
},
|
||||
{
|
||||
from: '/infos',
|
||||
to: 'https://api.frylabs.net/infos?version=true&motd=true&subjinfo=true',
|
||||
to: `https://${domain}/api/infos?version=true&motd=true&subjinfo=true`,
|
||||
nolog: true,
|
||||
},
|
||||
{
|
||||
|
@ -256,6 +249,7 @@ export default {
|
|||
name: 'Qmining',
|
||||
getApp: GetApp,
|
||||
setup: (data: SetupData): void => {
|
||||
domain = data.url
|
||||
userDB = data.userDB
|
||||
publicdirs = data.publicdirs
|
||||
nextdir = data.nextdir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue