diff --git a/src/http/index.ts b/src/http/index.ts index 7d41d17..122a6fa 100644 --- a/src/http/index.ts +++ b/src/http/index.ts @@ -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}`)