jina.serve.runtimes.gateway.http.app module#
- jina.serve.runtimes.gateway.http.app.get_fastapi_app(streamer, title, description, no_debug_endpoints, no_crud_endpoints, expose_endpoints, expose_graphql_endpoint, cors, logger, tracing=None, tracer_provider=None)[source]#
Get the app from FastAPI as the REST interface.
- Parameters:
streamer (
GatewayStreamer
) – gateway streamer objecttitle (
str
) – The title of this HTTP server. It will be used in automatics docs such as Swagger UI.description (
str
) – The description of this HTTP server. It will be used in automatics docs such as Swagger UI.no_debug_endpoints (
bool
) – If set, /status /post endpoints are removed from HTTP interface.no_crud_endpoints (
bool
) –If set, /index, /search, /update, /delete endpoints are removed from HTTP interface.
Any executor that has @requests(on=…) bound with those values will receive data requests.
expose_endpoints (
Optional
[str
]) – A JSON string that represents a map from executor endpoints (@requests(on=…)) to HTTP endpoints.expose_graphql_endpoint (
bool
) – If set, /graphql endpoint is added to HTTP interface.cors (
bool
) – If set, a CORS middleware is added to FastAPI frontend to allow cross-origin access.logger (
JinaLogger
) – Jina logger.tracing (
Optional
[bool
]) – Enables tracing if set to True.tracer_provider (
Optional
[TracerProvider
]) – If tracing is enabled the tracer_provider will be used to instrument the code.
- Returns:
fastapi app