22 lines
492 B
Python
22 lines
492 B
Python
"""Run the build API with Uvicorn."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
import uvicorn
|
|
|
|
from .app import create_application
|
|
|
|
|
|
def main() -> None:
|
|
host = os.environ.get("BUILD_API_HOST", "127.0.0.1")
|
|
port = int(os.environ.get("BUILD_API_PORT", "8081"))
|
|
application = create_application()
|
|
print(f"build API listening on http://{host}:{port}", flush=True)
|
|
uvicorn.run(application, host=host, port=port, log_level="info")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|