Skip to content

Commit

Permalink
add healthz route
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalef committed May 24, 2023
1 parent 877b3af commit aaef341
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import spacy
import srsly # type: ignore
from fastapi import Body, FastAPI
from starlette.responses import RedirectResponse
from fastapi import Body, FastAPI, status
from starlette.responses import PlainTextResponse, RedirectResponse

from app.entity_models import Request, Response
from app.spacy_extractor import SpacyExtractor
Expand All @@ -22,6 +22,11 @@
extractor = SpacyExtractor(nlp)


@app.get("/healthz", response_model=str, status_code=status.HTTP_200_OK)
def health():
return PlainTextResponse(".")


@app.get("/", include_in_schema=False)
def docs_redirect():
return RedirectResponse("/docs")
Expand Down

0 comments on commit aaef341

Please sign in to comment.