scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.4k stars 225 forks source link

Trailing slashes get automatically removed by AWS API Gateway, but swagger-ui-express requires it. #335

Open jeremy85 opened 1 year ago

jeremy85 commented 1 year ago

Trailing slashes get automatically removed by AWS API Gateway, but swagger-ui-express requires it. Page displays "Redirecting to /docs/" and not swagger UI.

I tried changing:

app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); to app.use('/docs/', swaggerUi.serve, swaggerUi.setup(swaggerSpec));

...but neither work.

scottie1984 commented 1 year ago

Fix is here perhaps: https://github.com/scottie1984/swagger-ui-express/issues/140. Maybe this one https://github.com/scottie1984/swagger-ui-express/issues/140#issuecomment-752850014