Update 2025-04-13_16:41:14
This commit is contained in:
22
main.py
Normal file
22
main.py
Normal file
@ -0,0 +1,22 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
async def root():
|
||||
with open("static/index.html") as f:
|
||||
return f.read()
|
||||
|
||||
@app.get("/get_level/{level}")
|
||||
async def get_level(level: int):
|
||||
# For now, return a static range; adjust based on your game logic
|
||||
return {"multiplier_range": [1, 10]}
|
||||
|
||||
@app.post("/submit_score/")
|
||||
async def submit_score(data: dict):
|
||||
# For now, just return success; add database logic if needed
|
||||
return {"status": "success"}
|
Reference in New Issue
Block a user