File size: 613 Bytes
2c7cc75 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | print("--- [1] STARTING SERVER SCRIPT ---")
from fastapi import FastAPI
from pydantic import BaseModel
import uvicorn
print("--- [2] IMPORTS COMPLETE ---")
app = FastAPI()
@app.get("/")
def home():
return {"status": "Debug Server Running"}
@app.post("/predict")
def predict(data: dict):
print("Received request!")
return {
"error_type": "Test Error",
"confidence": 99.9,
"recommendation": "Connection Successful!"
}
print("--- [3] APP DEFINED. READY TO RUN. ---")
if __name__ == "__main__":
uvicorn.run(app, host="127.0.0.1", port=8000) |