Disable swaggerUI in production env

What is the optimal way of disabling access to SwaggerUI in production environment? Currently I'm doing const router = env.ENVIRONMENT === 'local' ? OpenAPIRouter() : Router()
1 Reply
0x0dd154
0x0dd15411mo ago
I think you only have access to this in your fetch handler. So depending on how that looks it will need handling there with either middleware on the router or in the handlers for your openapi endpoints.
Want results from more Discord servers?
Add your server