Spaces:
Running
Running
File size: 1,019 Bytes
af1ae43 c9554cf af1ae43 51747e6 af1ae43 c9554cf af1ae43 304e233 af1ae43 c9554cf af1ae43 c9554cf af1ae43 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import os
import uvicorn
from cua2_core.app import app
from cua2_core.routes.routes import router
from cua2_core.routes.websocket import router as websocket_router
# Include routes
app.include_router(router, prefix="/api")
app.include_router(websocket_router)
# Health check endpoint (without prefix)
@app.get("/health")
async def health():
return {"status": "healthy", "service": "cua2-core"}
if __name__ == "__main__":
# Get configuration from environment variables
host = os.getenv("HOST", "0.0.0.0")
port = int(os.getenv("PORT", 8000))
debug = os.getenv("DEBUG", "false").lower() == "true"
print(f"Starting Computer Use Backend on {host}:{port}")
print(f"Debug mode: {debug}")
print(f"API Documentation: http://{host}:{port}/docs")
print(f"WebSocket endpoint: ws://{host}:{port}/ws")
uvicorn.run(
"cua2_core.app:app",
host=host,
port=port,
# reload=debug,
reload=True,
log_level="info" if not debug else "debug",
)
|