From 6f0c8403d15bbb72214278fea13a81d67ff683b8 Mon Sep 17 00:00:00 2001 From: Felix Faerber Date: Wed, 27 May 2026 13:09:53 +0300 Subject: [PATCH] redirect apex / to /swagger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index cb0642b..6d7e43d 100644 --- a/src/api.ts +++ b/src/api.ts @@ -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';