python_template_server.main

FastAPI template server using uvicorn.

Functions

run()

Serve the FastAPI application using uvicorn.

Classes

ExampleServer([config_filepath, config, ...])

Example server inheriting from TemplateServer.

class python_template_server.main.ExampleServer(config_filepath=PosixPath('/home/runner/work/python-template-server/python-template-server/configuration/config.json'), config=None, static_dir=PosixPath('/home/runner/work/python-template-server/python-template-server/static'))[source]

Example server inheriting from TemplateServer.

__init__(config_filepath=PosixPath('/home/runner/work/python-template-server/python-template-server/configuration/config.json'), config=None, static_dir=PosixPath('/home/runner/work/python-template-server/python-template-server/static'))[source]

Initialize the ExampleServer by delegating to the template server.

Parameters:
property routers: list[BaseRouter]

Define the API routers for the server.

Return list[BaseRouter]:

List of API routers

validate_config(config_data)[source]

Validate configuration from the config.json file.

Return TemplateServerConfig:

Loaded configuration

Return type:

TemplateServerConfig

python_template_server.main.run()[source]

Serve the FastAPI application using uvicorn.

Raises:

SystemExit – If configuration fails to load or SSL certificate files are missing

Return type:

None