Skip to content

msaServer Module

.base


Attributes

ROOTPATH module-attribute

ROOTPATH = os.path.join(os.path.dirname(__file__))

server_runner module-attribute

server_runner: Optional[
    Union[MSAServerUvicorn, MSAServerGunicorn]
] = None

The created server instance

Functions

run

run(
    app_dir: str,
    app: str = "app:app",
    host: str = "127.0.0.1",
    port: int = 8090,
    server_type: str = "uvicorn",
)

Creates and starts a MSAServer Instance

PARAMETER DESCRIPTION
app_dir

The rootpath of your project, like: os.path.join(os.path.dirname(file))

TYPE: str

app

The module:application string, like 'app:app' or 'main:app'

TYPE: str DEFAULT: 'app:app'

host

IP/FQDN the server runs on

TYPE: str DEFAULT: '127.0.0.1'

port

The port the server binds and listen to

TYPE: int DEFAULT: 8090

server_type

The string for the server type to use 'uvicorn', everything else starts a Gunicorn Server

TYPE: str DEFAULT: 'uvicorn'


Last update: September 28, 2022
Created: September 28, 2022