samith-a commited on
Commit
b10f07b
·
verified ·
1 Parent(s): 9e02007

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ from fastapi import FastAPI
3
+
4
+ app = FastAPI()
5
+
6
+ @app.on_event("startup")
7
+ def on_startup():
8
+ print("✅ Space is live!")
9
+
10
+ @app.get("/ping")
11
+ def ping():
12
+ return {"ping": "pong"}
13
+
14
+ @app.post("/predict")
15
+ def predict(payload: dict):
16
+ # Echo back whatever JSON you send
17
+ return {"received": payload}