diff --git a/hakit/config.json b/hakit/config.json index 864a634..64bce18 100644 --- a/hakit/config.json +++ b/hakit/config.json @@ -1,6 +1,6 @@ { "name": "Hakit", - "version": "1.0.24", + "version": "1.0.25", "slug": "hakit", "init": false, "ingress": true, diff --git a/hakit/server/routes/run-application.ts b/hakit/server/routes/run-application.ts index a8d3de0..87a1296 100644 --- a/hakit/server/routes/run-application.ts +++ b/hakit/server/routes/run-application.ts @@ -13,6 +13,7 @@ let isAppRunning = false; export async function runApplication(app: Express) { const data = await getAddonInfo(); const htmlContent = readFileSync(DEFAULT_HTML_FILE, 'utf8'); + const basePath = data?.ingress_url || '/'; const pageContent = htmlContent.replace('{{baseUrl}}', data?.ingress_url || '/'); async function startApp() { // @ts-expect-error @@ -56,9 +57,10 @@ export async function runApplication(app: Express) { }); app.use((_req, res, next) => { const nextJsBuilt = existsSync(join(APP_DIRECTORY, 'app', '.next')); + console.log('_req.path', _req.path); // first check if the current path is the root level if (!nextJsBuilt && (_req.path === '/' || _req.path === '')) { - res.redirect(data?.ingress_url + '/config'); + res.redirect(basePath + 'config'); } else { next(); }