Kintsugi-Garden / scripts /probe_server.py
AI-Sherpa
Initial commit: Kintsugi Garden — Build Small Hackathon submission
4f04d05
raw
history blame contribute delete
702 Bytes
"""Probe: confirm sdk: gradio Spaces autoboot a gradio.Server app.
Push this as the only Python file in a throwaway Space copy with
sdk: gradio and verify both routes return 200. If they do, the design's
sdk: gradio assumption holds and we proceed. If they don't, halt and
execute fallback 2a (plain FastAPI host) per the spec.
"""
import gradio
from fastapi.responses import HTMLResponse
app = gradio.Server()
@app.get("/", response_class=HTMLResponse)
async def index():
return "<!doctype html><html><body><h1>probe ok</h1></body></html>"
@app.api(name="ping")
def ping() -> dict:
return {"ok": True}
if __name__ == "__main__":
app.launch(server_name="0.0.0.0", server_port=7860)