| import os | |
| import uvicorn | |
| import gradio as gr | |
| from fastapi.staticfiles import StaticFiles | |
| from api import app | |
| with gr.Blocks(title="Grid Royale — Gradio Panel", theme=gr.themes.Base()) as demo: | |
| gr.Markdown( | |
| "## ⚔️ Grid Royale\n" | |
| "The main spectator UI is at the [root of this Space](/).\n" | |
| "This panel exists for hackathon REQ-02 compliance and quick health checks." | |
| ) | |
| app = gr.mount_gradio_app(app, demo, path="/gradio") | |
| app.mount("/", StaticFiles(directory="frontend/static", html=True), name="frontend") | |
| if __name__ == "__main__": | |
| port = int(os.environ.get("PORT", 8000)) | |
| uvicorn.run(app, host="0.0.0.0", port=port) | |