Question · NestJS course · Module 11: Swagger and OpenAPI

Securing Swagger in Production

What is the best way to secure access to Swagger UI in a production environment?

Answer options

  • Hide the link to Swagger UI
  • Change the server port
  • Use basic auth middleware before the /api/docs path
  • It is not possible to secure Swagger UI

You can check the correct answer by solving this task in the CodeWorlds game.