Skip to content

Server

FastAPI server implementation for the aspyx service framework.

FastAPIServer(service_manager, component_registry)

Bases: Server

A server utilizing fastapi framework.

add_routes()

add everything that looks like a http endpoint

boot(module, host='0.0.0.0', port=8000, start=True) classmethod

boot the DI infrastructure of the supplied module and optionally start a fastapi thread given the url Args: module: the module to initialize the environment host: listen address port: the port

Returns:

Type Description
FastAPIServer

thr created server

start_fastapi(host)

start the fastapi server in a thread

RequestContext(app)

A request context is used to remember the current http request in the current thread

get_request() classmethod

Return the current http request

Returns:

Type Description
Request

the current http request