feat: project skeleton with health endpoint
This commit is contained in:
@@ -2,3 +2,9 @@
|
|||||||
|
|
||||||
# v1 runtime data (DB, backups, snapshots, exports, config with secrets)
|
# v1 runtime data (DB, backups, snapshots, exports, config with secrets)
|
||||||
data/
|
data/
|
||||||
|
|
||||||
|
# Python
|
||||||
|
.venv/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.pytest_cache/
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
3.12
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
|
||||||
|
app = FastAPI(title="chat")
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/health")
|
||||||
|
def health():
|
||||||
|
return {"status": "ok"}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[project]
|
||||||
|
name = "chat"
|
||||||
|
version = "0.1.0"
|
||||||
|
requires-python = ">=3.11"
|
||||||
|
dependencies = [
|
||||||
|
"fastapi>=0.110",
|
||||||
|
"uvicorn[standard]>=0.30",
|
||||||
|
"httpx>=0.27",
|
||||||
|
"pydantic>=2.6",
|
||||||
|
"pydantic-settings>=2.2",
|
||||||
|
"openai>=1.30",
|
||||||
|
"instructor>=1.3",
|
||||||
|
"tiktoken>=0.7",
|
||||||
|
"jinja2>=3.1",
|
||||||
|
"aiosqlite>=0.20",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = ["pytest>=8", "pytest-asyncio>=0.23", "freezegun>=1.4"]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
pythonpath = ["."]
|
||||||
|
asyncio_mode = "auto"
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
from fastapi.testclient import TestClient
|
||||||
|
from chat.app import app
|
||||||
|
|
||||||
|
|
||||||
|
def test_health_endpoint_returns_ok():
|
||||||
|
client = TestClient(app)
|
||||||
|
response = client.get("/health")
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.json() == {"status": "ok"}
|
||||||
Reference in New Issue
Block a user