galbendavids commited on
Commit
e161246
·
1 Parent(s): 1da3dc8

api: convert /health to POST and update README

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. app/api.py +5 -1
README.md CHANGED
@@ -127,9 +127,9 @@ curl -X POST {YOUR_ENDPOINT_URL}/ingest
127
  - The index will be stored under `.vector_index` (persist if using a volume)
128
 
129
  ### 7) Test the API
130
- - Health:
131
  ```
132
- curl -s {YOUR_ENDPOINT_URL}/health
133
  ```
134
  - Query:
135
  ```
 
127
  - The index will be stored under `.vector_index` (persist if using a volume)
128
 
129
  ### 7) Test the API
130
+ # Health (POST):
131
  ```
132
+ curl -X POST {YOUR_ENDPOINT_URL}/health
133
  ```
134
  - Query:
135
  ```
app/api.py CHANGED
@@ -32,8 +32,12 @@ class QueryResponse(BaseModel):
32
  results: List[Dict[str, Any]]
33
 
34
 
35
- @app.get("/health")
36
  def health() -> Dict[str, str]:
 
 
 
 
37
  return {"status": "ok"}
38
 
39
 
 
32
  results: List[Dict[str, Any]]
33
 
34
 
35
+ @app.post("/health")
36
  def health() -> Dict[str, str]:
37
+ """Healthcheck endpoint.
38
+
39
+ Converted to POST so all endpoints consistently use JSON/POST semantics.
40
+ """
41
  return {"status": "ok"}
42
 
43