test-for-cloud / app.py
Rohithm16's picture
Create app.py
f4f72e0 verified
raw
history blame contribute delete
308 Bytes
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
}