url module param fix, public dir fix

This commit is contained in:
mrfry 2023-05-01 09:20:22 +02:00
parent 5a34115869
commit dea75c6bf5
4 changed files with 1 additions and 13 deletions

View file

@ -47,20 +47,12 @@ const moduleName = 'API'
// stuff gotten from server.js
let userDB: Database
let url: string
let httpServer: http.Server
let httpsServer: https.Server
function GetApp(): ModuleType {
const app = express()
let domain: any = url.split('.')
domain.shift()
domain = domain.join('.') // "qmining.com"
logger.DebugLog(`Cookie domain: ${domain}`, 'cookie', 1)
// -------------------------------------------------------------------------------------------
app.use(
express.urlencoded({
limit: '10mb',
@ -197,7 +189,6 @@ function setupSubModules(
const loadedModData = mod.setup({
app: parentApp,
userDB: userDB,
url: url, // only used by userManagement.ts
moduleSpecificData: moduleSpecificData,
httpServer: httpServer,
httpsServer: httpsServer,
@ -217,7 +208,6 @@ export default {
getApp: GetApp,
setup: (data: SetupData): void => {
userDB = data.userDB
url = data.url
httpServer = data.httpServer
httpsServer = data.httpsServer
},

View file

@ -93,7 +93,6 @@ const validationTokenName = 'qmining' // readValidationTokenName()
function setup(data: SubmoduleData): Submodule {
const { app, userDB } = data
logger.DebugLog(`Cookie domain: ${constants.domain}`, 'cookie', 1)
const userCount = dbtools
.TableInfo(userDB, 'users')

View file

@ -78,7 +78,6 @@ interface Module {
}
export interface SetupData {
url: string
userDB?: Database
nextdir?: string
httpServer: http.Server

View file

@ -65,7 +65,7 @@ export const validateAndSetupFiles = (): boolean => {
return everythingValid
}
export const publicDir = './public'
export const publicDir = './public/'
export const readAndValidateFile = <T>(file: FileDescriptor): T => {
if (!file.schema) return null