-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (24 loc) · 766 Bytes
/
main.py
File metadata and controls
31 lines (24 loc) · 766 Bytes
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
28
29
30
31
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
# Enable CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)
received_modal_data = {}
@app.post("/")
async def receive_modal_data(modal_data: dict):
global received_modal_data
received_modal_data = modal_data
return {"message": "Data received successfully"}
@app.get('/photoReview')
async def get_photo_review():
global received_modal_data
received_modal_data['isPhotoReviewed'] = False
received_modal_data['whyRejected'] = "전신이 나오도록 촬영해주세요"
return received_modal_data
# uvicorn main:app --reload
# uvicorn main:app --reload