feat(cloud-api): add workspace application entrypoint

This commit is contained in:
2026-07-12 16:41:17 +08:00
parent 47dfc3b8c5
commit 2af8909b29
8 changed files with 88 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
from cloud_api.app import create_app
__all__ = ["create_app"]
+8
View File
@@ -0,0 +1,8 @@
from __future__ import annotations
from fastapi import FastAPI
def create_app() -> FastAPI:
"""Create the independently deployable cloud API application."""
return FastAPI(title="Device Cloud API")
+20
View File
@@ -0,0 +1,20 @@
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,
)