mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
removed some domain dependencies
This commit is contained in:
parent
f8a7c6a4e5
commit
bc45b11551
13 changed files with 17 additions and 31 deletions
|
@ -35,7 +35,6 @@ import { LinksSchema, validateJSON } from '../../types/typeSchemas'
|
|||
let publicdirs: string[] = []
|
||||
let userDB: Database
|
||||
let nextdir = ''
|
||||
let domain = ''
|
||||
|
||||
function GetApp(): ModuleType {
|
||||
app.use(
|
||||
|
@ -112,18 +111,10 @@ function GetApp(): ModuleType {
|
|||
// REDIRECTS
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// to be backwards compatible
|
||||
app.get('/ask', function (req: Request, res) {
|
||||
logger.DebugLog(`Qmining module ask redirect`, 'ask', 1)
|
||||
res.redirect(
|
||||
`http://${domain}/ask?q=${req.query.q}&subj=${req.query.subj}&data=${req.query.data}`
|
||||
)
|
||||
})
|
||||
|
||||
const simpleRedirects = [
|
||||
{
|
||||
from: '/install',
|
||||
to: `https://${domain}/moodle-test-userscript/stable.user.js`,
|
||||
to: `/moodle-test-userscript/stable.user.js`,
|
||||
},
|
||||
{
|
||||
from: '/servergit',
|
||||
|
@ -163,15 +154,15 @@ function GetApp(): ModuleType {
|
|||
},
|
||||
{
|
||||
from: '/allqr',
|
||||
to: `https://${domain}/api/allqr.txt`,
|
||||
to: `/api/allqr.txt`,
|
||||
},
|
||||
{
|
||||
from: '/allqr.txt',
|
||||
to: `https://${domain}/api/allqr.txt`,
|
||||
to: `/api/allqr.txt`,
|
||||
},
|
||||
{
|
||||
from: '/infos',
|
||||
to: `https://${domain}/api/infos?version=true&motd=true&subjinfo=true`,
|
||||
to: `/api/infos?version=true&motd=true&subjinfo=true`,
|
||||
nolog: true,
|
||||
},
|
||||
{
|
||||
|
@ -261,7 +252,6 @@ 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