From bbcd122a6c70920d405610ed76469db2ed15f16f Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sat, 21 Dec 2024 23:08:16 +0100 Subject: [PATCH] Potential fix? --- src/http/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}`)