fix publics envs

This commit is contained in:
srgooglo 2022-06-10 05:40:41 +02:00
parent bbf7d32ad0
commit 59523637f3
2 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import pmap from "../../utils/pMap"
const formidable = require("formidable")
export function resolveToUrl(filepath, req) {
const host = req ? (req.protocol + "://" + req.get("host")) : global.globalPublicURI
const host = req ? (req.protocol + "://" + req.get("host")) : global.globalPublicUri
return `${host}/storage/${filepath}`
}

View File

@ -89,7 +89,10 @@ class Server {
global.wsInterface = this.httpInstance.wsInterface
global.httpListenPort = this.listenPort
global.globalPublicURI = this.env.globalPublicURI
global.publicHostname = this.env.publicHostname
global.publicProtocol = this.env.publicProtocol
global.globalPublicUri = `${this.env.publicProtocol}://${this.env.publicHost}`
global.uploadPath = this.env.uploadPath ?? path.resolve(process.cwd(), "uploads")
global.uploadCachePath = this.env.uploadCachePath ?? path.resolve(process.cwd(), "cache")