Spaces:
Paused
Paused
File size: 308 Bytes
f4f72e0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Ping(BaseModel):
message: str
@app.get("/")
def root():
return {"status": "space is alive 🚀"}
@app.post("/echo")
def echo(data: Ping):
return {
"you_sent": data.message,
"working": True
}
|