mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Passing servers to modules, minor code refactor
This commit is contained in:
parent
314914e898
commit
a12aadf32d
5 changed files with 68 additions and 53 deletions
|
@ -40,6 +40,8 @@ const moduleName = 'API'
|
|||
let userDB
|
||||
let url
|
||||
let publicdirs = []
|
||||
let httpServer
|
||||
let httpsServer
|
||||
|
||||
function GetApp(): ModuleType {
|
||||
const app = express()
|
||||
|
@ -203,6 +205,8 @@ function setupSubModules(
|
|||
url: url,
|
||||
publicdirs: publicdirs,
|
||||
moduleSpecificData: moduleSpecificData,
|
||||
httpServer: httpServer,
|
||||
httpsServer: httpsServer,
|
||||
})
|
||||
moduleDatas.push(loadedModData || {})
|
||||
} catch (e) {
|
||||
|
@ -219,7 +223,9 @@ export default {
|
|||
getApp: GetApp,
|
||||
setup: (data: SetupData): void => {
|
||||
userDB = data.userDB
|
||||
url = data.url // eslint-disable-line
|
||||
url = data.url
|
||||
publicdirs = data.publicdirs
|
||||
httpServer = data.httpServer
|
||||
httpsServer = data.httpsServer
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue