Skip to content

Commit ee4a038

Browse files
committed
fix: move Swagger UI to /api-docs to allow errorHandler to work correctly
- Changed `app.use(openAPIRouter)` to `app.use("/api-docs", openAPIRouter")` - Prevents Swagger UI from interfering with unmatched routes and error propagation - Undefined routes now correctly return "Not Found" - Global errorHandler middleware now correctly captures all propagated errors
1 parent 823e915 commit ee4a038

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ app.use("/health-check", healthCheckRouter);
3131
app.use("/users", userRouter);
3232

3333
// Swagger UI
34-
app.use(openAPIRouter);
34+
app.use("/api-docs", openAPIRouter);
3535

3636
// Error handlers
3737
app.use(errorHandler());

0 commit comments

Comments
 (0)