forked from noxious/server
Potential fix?
This commit is contained in:
parent
23c437f0bc
commit
bbcd122a6c
@ -2,6 +2,7 @@ import { Application } from 'express'
|
||||
import { httpLogger } from '../utilities/logger'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { getAppPath } from '../utilities/storage'
|
||||
|
||||
async function addHttpRoutes(app: Application) {
|
||||
const routeFiles = fs.readdirSync(__dirname).filter((file) => {
|
||||
@ -9,7 +10,7 @@ async function addHttpRoutes(app: Application) {
|
||||
})
|
||||
|
||||
for (const file of routeFiles) {
|
||||
const route = await import(path.join(__dirname, file))
|
||||
const route = await import(getAppPath('http', file))
|
||||
// Use the router directly without additional path prefix
|
||||
app.use('/', route.default)
|
||||
httpLogger.info(`Loaded routes from ${file}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user