Update server information

This commit is contained in:
DingZQ
2024-12-07 16:59:18 +08:00
parent 9e855b4584
commit 65c9913e83
9 changed files with 40306 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ from tjnetwork import *
import asyncio
import threading
from multiprocessing import Value
from fastapi.middleware.cors import CORSMiddleware
JUNCTION = 0
RESERVOIR = 1
@@ -36,6 +37,14 @@ if not os.path.exists(tmpDir):
app = FastAPI()
# 配置 CORS 中间件
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # 允许所有来源
allow_credentials=True, # 允许传递凭证Cookie、HTTP 头等)
allow_methods=["*"], # 允许所有 HTTP 方法
allow_headers=["*"], # 允许所有 HTTP 头
)
# 定义一个共享变量
lock_simulation = Value('i', 0)