21 lines
519 B
Python
21 lines
519 B
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
from collections.abc import Sequence
|
|
|
|
|
|
def main(argv: Sequence[str] | None = None) -> None:
|
|
parser = argparse.ArgumentParser(description="Run the Device Cloud API")
|
|
parser.add_argument("--host", default="127.0.0.1")
|
|
parser.add_argument("--port", default=8001, type=int)
|
|
args = parser.parse_args(argv)
|
|
|
|
import uvicorn
|
|
|
|
uvicorn.run(
|
|
"cloud_api.app:create_app",
|
|
factory=True,
|
|
host=args.host,
|
|
port=args.port,
|
|
)
|