Exemplo n.º 1
0
def setup_server(app: App) -> None:
    from egoist.ext.serverprocess.lazyparams import find_free_port, create_sentinel_file

    app.include("egoist.ext.serverprocess")  # for add_server_process
    app.add_server_process(
        "uvicorn server:app --port {port}",
        params=dict(port=find_free_port),
        name="api-server",
        env={"SENTINEL": create_sentinel_file},
    )
Exemplo n.º 2
0
def includeme(app: App) -> None:
    from egoist.experimental.serverprocess.lazyparams import find_free_port, create_sentinel_file

    app.include("egoist.experimental.serverprocess")  # for add_server_process

    app.add_server_process(
        "gofmtrpc -addr :{port} -sentinel {sentinel}",
        params=dict(port=find_free_port, sentinel=create_sentinel_file),
        name=NAME,
    )