Skip to content

main

The initialization of the ASGI FastAPI application.

APP = FastAPI(title='OPTIMADE Gateway', description='A gateway server to query multiple OPTIMADE databases.', version=__version__) module-attribute

The FastAPI ASGI application.

get_root(request) async

GET /

Introspective overview of gateway server.

Note

Temporarily redirecting to GET /docs.

Source code in optimade_gateway/main.py
27
28
29
30
31
32
33
34
35
36
37
38
@APP.get("/", include_in_schema=False)
async def get_root(request: Request) -> RedirectResponse:
    """`GET /`

    Introspective overview of gateway server.

    !!! note
        Temporarily redirecting to `GET /docs`.
    """
    return RedirectResponse(
        request.url.replace(path=f"{request.url.path.strip('/')}/docs")
    )