Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| import uvicorn | |
| app = FastAPI(title="GDevelop Server") | |
| # السماح بطلبات CORS من GDevelop (أي مصدر) | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # الرقم الثابت | |
| SECRET_NUMBER = 1 | |
| def root(): | |
| return {"message": "🚀 خادم GDevelop يعمل!", "status": "online"} | |
| def get_number(): | |
| """يرجع الرقم السري فقط عند الاتصال""" | |
| return { | |
| "number": SECRET_NUMBER, | |
| "source": "huggingface-space", | |
| "connected": True | |
| } | |
| def health(): | |
| return {"status": "ok"} | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |