aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/web.py
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat_scholar/web.py')
-rw-r--r--fatcat_scholar/web.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py
index 5020bf1..4887aa6 100644
--- a/fatcat_scholar/web.py
+++ b/fatcat_scholar/web.py
@@ -100,11 +100,23 @@ async def home() -> Any:
@api.head("/", include_in_schema=False)
async def root_head() -> Any:
"""
- HTTP HEAD only for the root path. Requested by, eg, uptime monitoring
- tools. This is distinct from the CORS middleware.
+ HTTP HEAD only for the root path (and health check below). Requested by,
+ eg, uptime monitoring tools. This is distinct from the CORS middleware (for
+ OPTION).
"""
return Response()
+@api.get("/_health", operation_id="get_health")
+async def health() -> Any:
+ """
+ Checks that connection back to elasticsearch index is working.
+ """
+ return Response()
+
+@api.head("/_health", include_in_schema=False)
+async def health_head() -> Any:
+ return Response()
+
class HitsModel(BaseModel):
count_returned: int
count_found: int