Download server/launch_without_ui.py from blanchon/RobotHub-TransportServer: direct link, hf CLI and curl.
- Browser
- Download file 891 Bytes
-
https://huggingface.co/spaces/blanchon/RobotHub-TransportServer/resolve/main/server/launch_without_ui.py
- Command line
-
hf download hf://spaces/blanchon/RobotHub-TransportServer/server/launch_without_ui.py
-
curl -L -o launch_without_ui.py https://huggingface.co/spaces/blanchon/RobotHub-TransportServer/resolve/main/server/launch_without_ui.py
891 Bytes
| import logging | |
| import os | |
| import uvicorn | |
| # Import the existing API | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| handlers=[logging.StreamHandler()], | |
| ) | |
| logger = logging.getLogger(__name__) | |
| if __name__ == "__main__": | |
| port = int(os.getenv("PORT", "8000")) | |
| host = os.getenv("HOST", "0.0.0.0") | |
| logger.info("🤖 Starting RobotHub TransportServer API Server (Hot Reload Mode)...") | |
| logger.info(f" - API available at: http://{host}:{port}/") | |
| logger.info(f" - API docs at: http://{host}:{port}/docs") | |
| logger.info(" - Hot reload enabled for development") | |
| print( | |
| f"🤖 Starting RobotHub TransportServer API Server on {host}:{port} (Hot Reload)" | |
| ) | |
| uvicorn.run( | |
| "src.api:app", | |
| host=host, | |
| port=port, | |
| reload=True, | |
| log_level="info", | |
| ) | |