From 93f1ccaafd2819501f856ac3594ea16d3b921896 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 25 Mar 2021 11:07:45 -0700 Subject: web: small typos Thanks for catching these gio --- fatcat_scholar/templates/help.html | 4 ++-- fatcat_scholar/web.py | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/templates/help.html b/fatcat_scholar/templates/help.html index 1a1ffe4..67d3721 100644 --- a/fatcat_scholar/templates/help.html +++ b/fatcat_scholar/templates/help.html @@ -131,7 +131,7 @@ apply range queries like year:>1989 year:<2000.{% endtrans %} {{ search_macros.doi_access_button({'biblio': {'doi': '#'}}, is_oa=False) }} - {% trans %}A publisher landing page is the authoriative source for the "version of record" of a research publication, but content is not always accessible to the general public{% endtrans %} + {% trans %}A publisher landing page is the authoritative source for the "version of record" of a research publication, but content is not always accessible to the general public{% endtrans %} {{ search_macros.doi_access_button({'biblio': {'doi': '#'}}, is_oa=True) }} @@ -255,6 +255,6 @@ apply range queries like year:>1989 year:<2000.{% endtrans %} {% endblock %} 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 -- cgit v1.2.3