diff --git a/src/server/index.ts b/src/server/index.ts index 6d6aef6..379cec3 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -1803,7 +1803,9 @@ app.get('/src/i18n/*', serveStatic({ root: '.' })) // Admin HTML components - read file text explicitly to force Content-Length app.get('/admin/*', async (c) => { - const filePath = `./public${c.req.path}` + const path = c.req.path + // If path ends with /, it's a directory → serve admin SPA + const filePath = path.endsWith('/') ? './public/admin.html' : `./public${path}` const file = Bun.file(filePath) const text = await file.text() c.header('Content-Length', String(Buffer.byteLength(text, 'utf8')))