Disable swagger UI docs in production

This commit is contained in:
sabaimran 2024-01-24 15:23:39 +05:30
parent ddf6fd9c09
commit dbdca7d8d1

View file

@ -45,7 +45,10 @@ with redirect_stdout(collectstatic_output):
call_command("collectstatic", "--noinput")
# Initialize the Application Server
app = FastAPI()
if os.getenv("KHOJ_DEBUG", "false").lower() == "true":
app = FastAPI(debug=True)
else:
app = FastAPI(docs_url=None) # Disable Swagger UI in production
# Get Django Application
django_app = get_asgi_application()