mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Global site url source
This commit is contained in:
parent
61c71e6c8d
commit
d841e464f5
7 changed files with 37 additions and 17 deletions
|
@ -23,6 +23,7 @@ const bodyParser = require('body-parser')
|
|||
const busboy = require('connect-busboy')
|
||||
const fs = require('fs')
|
||||
const app = express()
|
||||
let url = ''
|
||||
|
||||
const logger = require('../utils/logger.js')
|
||||
// const utils = require('../utils/utils.js')
|
||||
|
@ -91,7 +92,8 @@ app.get('/*', function (req, res) {
|
|||
res.render('stuff/folders', {
|
||||
folders: f,
|
||||
dirname: relPath,
|
||||
prevDir
|
||||
prevDir,
|
||||
url
|
||||
})
|
||||
} else {
|
||||
let fileStream = fs.createReadStream(curr)
|
||||
|
@ -99,7 +101,8 @@ app.get('/*', function (req, res) {
|
|||
}
|
||||
} catch (e) {
|
||||
res.render('stuff/nofile', {
|
||||
missingFile: curr
|
||||
missingFile: curr,
|
||||
url
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -118,5 +121,8 @@ app.post('*', function (req, res) {
|
|||
})
|
||||
|
||||
exports.app = app
|
||||
exports.setup = (x) => {
|
||||
url = x.url
|
||||
}
|
||||
|
||||
logger.Log('Stuff module started', logger.GetColor('yellow'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue