Zenkad commited on
Commit
880b7e0
·
verified ·
1 Parent(s): 70e784c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from pydantic import BaseModel
3
+
4
+ app = FastAPI()
5
+
6
+ class Chat(BaseModel):
7
+ message: str
8
+
9
+ @app.get("/")
10
+ def root():
11
+ return {"status": "ZenkaMind test API çalışıyor"}
12
+
13
+ @app.get("/health")
14
+ def health():
15
+ return {"ok": True}
16
+
17
+ @app.post("/api/chat")
18
+ def chat(data: Chat):
19
+ return {
20
+ "response": f"Mesaj alındı: {data.message}"
21
+ }