Spaces:
Running
Running
Download app.py from BlueMoonBot/BubbleBot: direct link, hf CLI and curl.
- Browser
- Download file 716 Bytes
-
https://huggingface.co/spaces/BlueMoonBot/BubbleBot/resolve/main/app.py
- Command line
-
hf download hf://spaces/BlueMoonBot/BubbleBot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/BlueMoonBot/BubbleBot/resolve/main/app.py
716 Bytes
| import asyncio | |
| from fastapi import FastAPI | |
| import uvicorn | |
| app = FastAPI() | |
| def home(): | |
| return {"status": "Lichess bot is running!"} | |
| async def run_lichess_bot(): | |
| print("Starting Lichess bot...") | |
| # --- YOUR COURSERA / LICHESS BOT CODE GOES HERE --- | |
| # Example: | |
| # while True: | |
| # await check_lichess_games() | |
| # await asyncio.sleep(1) | |
| pass | |
| async def startup_event(): | |
| # This fires off your chess bot in the background | |
| # so it doesn't block the web server from starting | |
| asyncio.create_task(run_lichess_bot()) | |
| if __name__ == "__main__": | |
| # Hugging Face strictly requires port 7860 | |
| uvicorn.run(app, host="0.0.0.0", port=7860) |