Explorar el Código

test progress bar

ming hace 3 años
padre
commit
e77199e4f4
Se han modificado 1 ficheros con 17 adiciones y 1 borrados
  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/'