Skip to content

main

Main entry point for the FastAPI application.

on_startup

on_startup()

Event handler for application startup. Creates tables in the database.

Source code in api/main.py
17
18
19
20
21
22
23
@app.on_event("startup")
def on_startup():
    """
    Event handler for application startup.
    Creates tables in the database.
    """
    database.create_tables()

health_check

health_check()

Endpoint for performing health check.

Returns:

Type Description
HealthCheck

The health check response.

Source code in api/main.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@app.get(
    "/healthcheck",
    tags=["healthcheck"],
    response_model=models.HealthCheck,
    status_code=status.HTTP_200_OK,
)
def health_check():
    """
    Endpoint for performing health check.

    Returns
    -------
    models.HealthCheck
        The health check response.
    """
    return models.HealthCheck(status="OK")