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
|
// stuff gotten from server.js
|
||||||
let userDB: Database
|
let userDB: Database
|
||||||
let url: string
|
|
||||||
let httpServer: http.Server
|
let httpServer: http.Server
|
||||||
let httpsServer: https.Server
|
let httpsServer: https.Server
|
||||||
|
|
||||||
function GetApp(): ModuleType {
|
function GetApp(): ModuleType {
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
let domain: any = url.split('.')
|
|
||||||
domain.shift()
|
|
||||||
domain = domain.join('.') // "qmining.com"
|
|
||||||
logger.DebugLog(`Cookie domain: ${domain}`, 'cookie', 1)
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
express.urlencoded({
|
express.urlencoded({
|
||||||
limit: '10mb',
|
limit: '10mb',
|
||||||
|
@ -197,7 +189,6 @@ function setupSubModules(
|
||||||
const loadedModData = mod.setup({
|
const loadedModData = mod.setup({
|
||||||
app: parentApp,
|
app: parentApp,
|
||||||
userDB: userDB,
|
userDB: userDB,
|
||||||
url: url, // only used by userManagement.ts
|
|
||||||
moduleSpecificData: moduleSpecificData,
|
moduleSpecificData: moduleSpecificData,
|
||||||
httpServer: httpServer,
|
httpServer: httpServer,
|
||||||
httpsServer: httpsServer,
|
httpsServer: httpsServer,
|
||||||
|
@ -217,7 +208,6 @@ export default {
|
||||||
getApp: GetApp,
|
getApp: GetApp,
|
||||||
setup: (data: SetupData): void => {
|
setup: (data: SetupData): void => {
|
||||||
userDB = data.userDB
|
userDB = data.userDB
|
||||||
url = data.url
|
|
||||||
httpServer = data.httpServer
|
httpServer = data.httpServer
|
||||||
httpsServer = data.httpsServer
|
httpsServer = data.httpsServer
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,7 +93,6 @@ const validationTokenName = 'qmining' // readValidationTokenName()
|
||||||
|
|
||||||
function setup(data: SubmoduleData): Submodule {
|
function setup(data: SubmoduleData): Submodule {
|
||||||
const { app, userDB } = data
|
const { app, userDB } = data
|
||||||
logger.DebugLog(`Cookie domain: ${constants.domain}`, 'cookie', 1)
|
|
||||||
|
|
||||||
const userCount = dbtools
|
const userCount = dbtools
|
||||||
.TableInfo(userDB, 'users')
|
.TableInfo(userDB, 'users')
|
||||||
|
|
|
@ -78,7 +78,6 @@ interface Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SetupData {
|
export interface SetupData {
|
||||||
url: string
|
|
||||||
userDB?: Database
|
userDB?: Database
|
||||||
nextdir?: string
|
nextdir?: string
|
||||||
httpServer: http.Server
|
httpServer: http.Server
|
||||||
|
|
|
@ -65,7 +65,7 @@ export const validateAndSetupFiles = (): boolean => {
|
||||||
return everythingValid
|
return everythingValid
|
||||||
}
|
}
|
||||||
|
|
||||||
export const publicDir = './public'
|
export const publicDir = './public/'
|
||||||
|
|
||||||
export const readAndValidateFile = <T>(file: FileDescriptor): T => {
|
export const readAndValidateFile = <T>(file: FileDescriptor): T => {
|
||||||
if (!file.schema) return null
|
if (!file.schema) return null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue