pre-commit-ci-lite[bot]
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
11 additions and
8 deletions
-
test_app.py
|
|
@ -8,21 +8,24 @@ app = FastAPI( |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl -X GET http://127.0.0.1:8000/ |
|
|
curl -X GET http://127.0.0.1:8000/ |
|
|
""" |
|
|
""", |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HealthResponse(BaseModel): |
|
|
class HealthResponse(BaseModel): |
|
|
status: str |
|
|
status: str |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.get("/") |
|
|
@app.get("/") |
|
|
def root(): |
|
|
def root(): |
|
|
return "Hello World" |
|
|
return "Hello World" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.get( |
|
|
@app.get( |
|
|
"/health", |
|
|
"/health", |
|
|
response_model=HealthResponse, |
|
|
response_model=HealthResponse, |
|
|
summary="Health check endpoint", |
|
|
summary="Health check endpoint", |
|
|
tags=["System"] |
|
|
tags=["System"], |
|
|
) |
|
|
) |
|
|
def health_check(): |
|
|
def health_check(): |
|
|
return HealthResponse(status="healthy") |
|
|
return HealthResponse(status="healthy") |
|
|
|