CoolFace
Apppublic

BlueMoonBot/bluemoonbot_Lichess

sourceHugging Faceupdated 10d agoView on Hugging Face
0likes
app.py28 linesDownload Raw Back to root
1import asyncio2from fastapi import FastAPI3import uvicorn4 5app = FastAPI()6 7@app.get("/")8def home():9    return {"status": "Lichess bot is running!"}10 11async def run_lichess_bot():12    print("Starting Lichess bot...")13    # --- YOUR COURSERA / LICHESS BOT CODE GOES HERE ---14    # Example:15    # while True:16    #     await check_lichess_games()17    #     await asyncio.sleep(1)18    pass19 20@app.on_event("startup")21async def startup_event():22    # This fires off your chess bot in the background 23    # so it doesn't block the web server from starting24    asyncio.create_task(run_lichess_bot())25 26if __name__ == "__main__":27    # Hugging Face strictly requires port 786028    uvicorn.run(app, host="0.0.0.0", port=7860)