Skip to content

Commit

Permalink
Update: remove routes from api schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
pipoe2h committed May 4, 2024
1 parent 28d94fa commit ab35a3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


SQLALCHEMY_DATABASE_URL = f"postgresql+psycopg2://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_ADDRESS}:{POSTGRES_PORT}/{POSTGRES_DB}"
print(SQLALCHEMY_DATABASE_URL)

engine = create_engine(
SQLALCHEMY_DATABASE_URL,
Expand Down
8 changes: 4 additions & 4 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def custom_route_handler(request: Request) -> Response:


app = FastAPI(
title="Nutanix .NEXT Demo",
title="Nutanix Cloud Native Demo",
description="Demo Payment API based on FastAPI with Swagger and Sqlachemy[postgres]",
version="1.0.0"
)
Expand All @@ -61,15 +61,15 @@ def get_settings():
return config.Settings()

# Read .env
@app.get("/info")
@app.get("/info", include_in_schema=False)
async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
return {
"account_name": settings.account_name,
"currencies": settings.currencies,
}

# index page, welcome
@app.get("/")
@app.get("/", include_in_schema=False)
async def index(request: Request, settings: Annotated[config.Settings, Depends(get_settings)]):
return templates.TemplateResponse(
name="index.html", context={
Expand All @@ -85,7 +85,7 @@ class FormData(BaseModel):
amount: float
description: str

@app.post("/process_form_data")
@app.post("/process_form_data", include_in_schema=False)
async def process_form_data(form_data: FormData):
print(form_data.dict())
async with httpx.AsyncClient() as client:
Expand Down

0 comments on commit ab35a3a

Please sign in to comment.