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 publicdirs: string[] = []
|
||||||
let userDB: Database
|
let userDB: Database
|
||||||
let nextdir = ''
|
let nextdir = ''
|
||||||
|
let domain = ''
|
||||||
|
|
||||||
function GetApp(): ModuleType {
|
function GetApp(): ModuleType {
|
||||||
app.use(
|
app.use(
|
||||||
|
@ -119,18 +120,14 @@ function GetApp(): ModuleType {
|
||||||
app.get('/ask', function (req: Request, res) {
|
app.get('/ask', function (req: Request, res) {
|
||||||
logger.DebugLog(`Qmining module ask redirect`, 'ask', 1)
|
logger.DebugLog(`Qmining module ask redirect`, 'ask', 1)
|
||||||
res.redirect(
|
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 = [
|
const simpleRedirects = [
|
||||||
{
|
|
||||||
from: '/dataeditor',
|
|
||||||
to: 'https://dataeditor.frylabs.net',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
from: '/install',
|
from: '/install',
|
||||||
to: 'https://qmining.frylabs.net/moodle-test-userscript/stable.user.js',
|
to: `https://${domain}/moodle-test-userscript/stable.user.js`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: '/servergit',
|
from: '/servergit',
|
||||||
|
@ -148,10 +145,6 @@ function GetApp(): ModuleType {
|
||||||
from: '/classesgit',
|
from: '/classesgit',
|
||||||
to: 'https://gitlab.com/MrFry/question-classes',
|
to: 'https://gitlab.com/MrFry/question-classes',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
from: '/addQuestion',
|
|
||||||
to: 'https://dataeditor.frylabs.net',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
from: '/donate',
|
from: '/donate',
|
||||||
to: links.donate,
|
to: links.donate,
|
||||||
|
@ -174,15 +167,15 @@ function GetApp(): ModuleType {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: '/allqr',
|
from: '/allqr',
|
||||||
to: 'https://api.frylabs.net/allqr.txt',
|
to: `https://${domain}/api/allqr.txt`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: '/allqr.txt',
|
from: '/allqr.txt',
|
||||||
to: 'https://api.frylabs.net/allqr.txt',
|
to: `https://${domain}/api/allqr.txt`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: '/infos',
|
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,
|
nolog: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -256,6 +249,7 @@ export default {
|
||||||
name: 'Qmining',
|
name: 'Qmining',
|
||||||
getApp: GetApp,
|
getApp: GetApp,
|
||||||
setup: (data: SetupData): void => {
|
setup: (data: SetupData): void => {
|
||||||
|
domain = data.url
|
||||||
userDB = data.userDB
|
userDB = data.userDB
|
||||||
publicdirs = data.publicdirs
|
publicdirs = data.publicdirs
|
||||||
nextdir = data.nextdir
|
nextdir = data.nextdir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue