mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
It sounds like PySide2 will not be moving to Python 3.11, so we're stuck on 3.10 without this. Upgrading to a newer Qt also fixes some high DPI bugs (the file browser dialog for save/load is no longer tiny on 4k). https://github.com/pyinstaller/pyinstaller/issues/5414 previously blocked this, but the bug appears to be fixed now.
48 lines
1.0 KiB
Python
48 lines
1.0 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from . import (
|
|
controlpoints,
|
|
debuggeometries,
|
|
eventstream,
|
|
flights,
|
|
frontlines,
|
|
game,
|
|
iadsnetwork,
|
|
mapzones,
|
|
navmesh,
|
|
qt,
|
|
supplyroutes,
|
|
tgos,
|
|
waypoints,
|
|
)
|
|
from .settings import ServerSettings
|
|
|
|
app = FastAPI()
|
|
app.include_router(controlpoints.router)
|
|
app.include_router(debuggeometries.router)
|
|
app.include_router(eventstream.router)
|
|
app.include_router(flights.router)
|
|
app.include_router(frontlines.router)
|
|
app.include_router(game.router)
|
|
app.include_router(mapzones.router)
|
|
app.include_router(navmesh.router)
|
|
app.include_router(qt.router)
|
|
app.include_router(supplyroutes.router)
|
|
app.include_router(tgos.router)
|
|
app.include_router(waypoints.router)
|
|
app.include_router(iadsnetwork.router)
|
|
|
|
|
|
origins = ["file://"]
|
|
if ServerSettings.get().cors_allow_debug_server:
|
|
origins.append("http://localhost:3000")
|
|
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=origins,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|