|
@@ -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/'
|