Browse Source

Improve quick start documentation and add health endpoint

pull/14570/head
Deshna 7 months ago
parent
commit
94c77710f5
  1. 28
      test_app.py

28
test_app.py

@ -0,0 +1,28 @@
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI(
title="FastAPI",
description="""
## 🚀 Quick Start
```bash
curl -X GET http://127.0.0.1:8000/
"""
)
class HealthResponse(BaseModel):
status: str
@app.get("/")
def root():
return "Hello World"
@app.get(
"/health",
response_model=HealthResponse,
summary="Health check endpoint",
tags=["System"]
)
def health_check():
return HealthResponse(status="healthy")
Loading…
Cancel
Save