File size: 312 Bytes
b10f07b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# app.py
from fastapi import FastAPI

app = FastAPI()

@app.on_event("startup")
def on_startup():
    print("✅ Space is live!")

@app.get("/ping")
def ping():
    return {"ping": "pong"}

@app.post("/predict")
def predict(payload: dict):
    # Echo back whatever JSON you send
    return {"received": payload}