Folders view tidy up, fix path with spaces, update url added to qmining

This commit is contained in:
MrFry 2019-10-24 15:05:08 +02:00
parent d5cf846433
commit 90de7e926b
5 changed files with 160 additions and 135 deletions

View file

@ -153,6 +153,12 @@ app.get('/greasy', function (req, res) {
logger.LogReq(req)
})
app.get('/update', function (req, res) {
res.redirect('http://qmining.frylabs.net/moodle-test-userscript/stable.user.js')
res.end()
logger.LogReq(req)
})
app.get('/install', function (req, res) {
res.redirect('http://qmining.frylabs.net/moodle-test-userscript/stable.user.js')
res.end()

View file

@ -49,7 +49,8 @@ app.use(bodyParser.json({
// --------------------------------------------------------------
app.get('/*', function (req, res) {
let curr = listedFiles + '/' + req.url.substring('/'.length, req.url.length).split('?')[0]
let parsedUrl = req.url.replace(/%20/g, " ")
let curr = listedFiles + '/' + parsedUrl.substring('/'.length, parsedUrl.length).split('?')[0]
let relPath = curr.substring('./public/files'.length, curr.length)
if (relPath[relPath.length - 1] !== '/') { relPath += '/' }