Skip to content

Commit

Permalink
feat: disable openapi docs in production
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyalv committed May 27, 2024
1 parent 62cfcc1 commit 1947a79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)
from src.utils.db import Base, engine

from src.utils.settings import ENV_TYPE

sentry_sdk.init(
dsn=SENTRY_DSN,
Expand All @@ -43,7 +44,9 @@
profiles_sample_rate=1.0,
)

app = FastAPI()
OPENAPI_URL = "/openapi.json" if ENV_TYPE == "DEV" else ""

app = FastAPI(openapi_url=OPENAPI_URL)

# CORS
app.add_middleware(
Expand Down

0 comments on commit 1947a79

Please sign in to comment.