backkend / app.py
Muleex12's picture
Update app.py
f2d8c8f verified
Raw History Blame Contribute Delete
350 Bytes
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
def home():
return {"message": "Backend is running"}
@app.post("/v1/predict")
def predict(data: dict):
weight = data.get("weight")
mpg = data.get("mpg")
# dummy prediction (we will replace later)
result = weight + mpg
return {"prediction": result}