diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-03-05 16:27:51 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-03-05 16:27:53 -0800 |
commit | c2be7c87604972c75f5ee8f5794018c378e586d8 (patch) | |
tree | 3ff12a73b7cb7e6731a8c20dd9a8b274fc95c777 /fatcat_scholar/web.py | |
parent | cbbb5993f241cdc1afae73b31bc0a7304d3ae2d8 (diff) | |
download | fatcat-scholar-c2be7c87604972c75f5ee8f5794018c378e586d8.tar.gz fatcat-scholar-c2be7c87604972c75f5ee8f5794018c378e586d8.zip |
web: respond to HTTP HEAD / (for uptime monitoring)
Proper HTTP HEAD support for all endpoints would be better, but don't
want to break CORS stuff by hacking it.
Diffstat (limited to 'fatcat_scholar/web.py')
-rw-r--r-- | fatcat_scholar/web.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index dce732b..a268bf8 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -84,6 +84,13 @@ api = APIRouter() async def home() -> Any: return {"endpoints": {"/": "this", "/search": "fulltext search"}} +@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. + """ + return Response() class HitsModel(BaseModel): count_returned: int |