mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
url module param fix, public dir fix
This commit is contained in:
parent
5a34115869
commit
dea75c6bf5
4 changed files with 1 additions and 13 deletions
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -78,7 +78,6 @@ interface Module {
|
|||
}
|
||||
|
||||
export interface SetupData {
|
||||
url: string
|
||||
userDB?: Database
|
||||
nextdir?: string
|
||||
httpServer: http.Server
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue