Kaynağa Gözat

test progress bar

ming 3 yıl önce
ebeveyn
işleme
e77199e4f4
1 değiştirilmiş dosya ile 17 ekleme ve 1 silme
  1. 17 1
      main.py

+ 17 - 1
main.py

@@ -25,8 +25,24 @@ from websocket import create_connection
 #service nginx restart
 #uvicorn main:app --host="0.0.0.0" --reload --port 8888
 
-
 app = FastAPI()
+origins = [
+    "https://hhh.com.tw"
+    "http://172.105.205.52",
+    "http://172.105.205.52:8001",
+    "http://172.104.93.163",
+]
+
+app.add_middleware(
+    CORSMiddleware,
+    # allow_origins=origins,
+    allow_origins=["*"],
+    allow_credentials=True,
+    allow_methods=["*"],
+    allow_headers=["*"],
+)
+
+
 dir_sound = 'mp3_track/'
 dir_photo = 'photo/'
 dir_text = 'text_file/'