mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
global public dir for every server module
This commit is contained in:
@@ -69,7 +69,6 @@ interface Modules {
|
||||
|
||||
interface Module {
|
||||
path: string
|
||||
publicdirs: Array<string>
|
||||
name: string
|
||||
route: string
|
||||
nextdir?: string
|
||||
@@ -81,7 +80,6 @@ interface Module {
|
||||
|
||||
export interface SetupData {
|
||||
url: string
|
||||
publicdirs: Array<string>
|
||||
userDB?: Database
|
||||
nextdir?: string
|
||||
httpServer: http.Server
|
||||
@@ -233,15 +231,10 @@ Object.keys(modules).forEach(function (key) {
|
||||
const mod = require(module.path).default // eslint-disable-line
|
||||
// const mod = require(module.path)
|
||||
|
||||
module.publicdirs.forEach((pdir) => {
|
||||
utils.CreatePath(pdir)
|
||||
})
|
||||
|
||||
if (mod.setup) {
|
||||
mod.setup({
|
||||
url: constants.domain, // used by api.ts -> userManagement.ts -> cookies
|
||||
userDB: userDB,
|
||||
publicdirs: module.publicdirs,
|
||||
nextdir: module.nextdir,
|
||||
httpServer: httpServer,
|
||||
httpsServer: httpsServer,
|
||||
|
||||
Reference in New Issue
Block a user