Starting the application with CLI command

This commit is contained in:
Ivan Golikov 2025-01-02 23:59:06 +01:00
parent de52702f8d
commit 759c338657
2 changed files with 61 additions and 4 deletions

View file

@ -1,6 +1,25 @@
import click
import uvicorn
@click.command()
def cli():
print("Hello, world")
@click.option(
"--host", default="127.0.0.1", show_default=True, help="Bind socket to this host."
)
@click.option(
"--port",
default=8000,
show_default=True,
help="Bind socket to this port. If 0, an available port will be picked.",
)
@click.option("--uds", help="Bind to a UNIX domain socket.")
@click.option(
"--workers",
help=(
"Number of worker processes. "
"Defaults to the $WEB_CONCURRENCY environment variable if available, or 1."
),
type=int,
)
def cli(**kwargs) -> None:
uvicorn.run("pssecret_server.main:app", **kwargs)