mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Qmining redirect routes, handling all pages, removed unecesary api code
This commit is contained in:
parent
cbdece54f8
commit
2caf368b95
5 changed files with 90 additions and 72 deletions
|
@ -18,8 +18,6 @@
|
|||
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
let url = ''
|
||||
|
||||
const express = require('express')
|
||||
const bodyParser = require('body-parser')
|
||||
const busboy = require('connect-busboy')
|
||||
|
@ -38,12 +36,6 @@ const dataFile = 'public/data.json'
|
|||
const msgFile = 'stats/msgs'
|
||||
const motdFile = 'public/motd'
|
||||
const versionFile = 'public/version'
|
||||
let donateURL = ''
|
||||
try {
|
||||
donateURL = utils.ReadFile('./data/donateURL')
|
||||
} catch (e) {
|
||||
logger.Log('Couldnt read donate URL file!', logger.GetColor('red'))
|
||||
}
|
||||
|
||||
app.set('view engine', 'ejs')
|
||||
app.set('views', [
|
||||
|
@ -96,13 +88,7 @@ Load()
|
|||
// --------------------------------------------------------------
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
res.end('hai')
|
||||
})
|
||||
|
||||
app.get('/manual', function (req, res) {
|
||||
res.render('man')
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
res.redirect('https://www.youtube.com/watch?v=ieqGJgqiXFk')
|
||||
})
|
||||
|
||||
app.post('/postfeedback', function (req, res) {
|
||||
|
@ -112,50 +98,6 @@ app.post('/postfeedback', function (req, res) {
|
|||
res.end()
|
||||
})
|
||||
|
||||
app.get('/lred', function (req, res) {
|
||||
res.redirect('/legacy') // TODO: redirect to react legacy
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/menuClick', function (req, res) {
|
||||
res.redirect('/') // TODO: redirect to react /
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/install', function (req, res) {
|
||||
res.redirect(url + '/moodle-test-userscript/stable.user.js?install')
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/donate', function (req, res) {
|
||||
res.redirect(donateURL)
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/thanks', function (req, res) {
|
||||
res.render('thanks', { // TODO: redirect to react thanks
|
||||
siteurl: url
|
||||
})
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/classesgit', function (req, res) {
|
||||
res.redirect('https://gitlab.com/MrFry/question-classes')
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/scriptgit', function (req, res) {
|
||||
res.redirect('https://gitlab.com/MrFry/moodle-test-userscript')
|
||||
res.end()
|
||||
logger.LogReq(req)
|
||||
})
|
||||
|
||||
app.get('/servergit', function (req, res) {
|
||||
res.redirect('https://gitlab.com/MrFry/mrfrys-node-server')
|
||||
res.end()
|
||||
|
@ -313,8 +255,5 @@ app.post('*', function (req, res) {
|
|||
})
|
||||
|
||||
exports.app = app
|
||||
exports.setup = (x) => {
|
||||
url = x.url
|
||||
}
|
||||
|
||||
logger.Log('API module started', logger.GetColor('yellow'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue