File size: 835 Bytes
4dabddd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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

@app.get("/")
def root():
    return {"message": "🚀 خادم GDevelop يعمل!", "status": "online"}

@app.get("/get-number")
def get_number():
    """يرجع الرقم السري فقط عند الاتصال"""
    return {
        "number": SECRET_NUMBER,
        "source": "huggingface-space",
        "connected": True
    }

@app.get("/health")
def health():
    return {"status": "ok"}

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=7860)