redirect apex / to /swagger

swagger({ path: '/' }) renders the UI at root but doesn't register the
/json spec route, so the embedded UI loads then 404s on its own spec.
Keep the plugin defaults and bounce / → /swagger instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Felix FaerberandClaude Opus 4.7 committed 2026-05-27 13:09:53 +03:00
1 parent 97b8103c37
commit 6f0c8403d1
1 file changed
+2 -1
+2 -1
View File
@@ -12,7 +12,8 @@ import { getGatewayContext } from './gateway/context';
const app = new Elysia()
.use(cors())
.use(swagger({ path: '/' }))
.use(swagger())
.get('/', ({ redirect }) => redirect('/swagger', 302))
.onError(({ error, set }) => {
const status = set.status ?? 500;
const message = (error as Error).message ?? 'Internal error';