mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-04-25 19:28:09 +00:00
18 lines
515 B
Python
Executable File
18 lines
515 B
Python
Executable File
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from server import state
|
|
from server.config_schema_router import router as config_schema_router
|
|
def init_app(app: FastAPI) -> None:
|
|
"""Apply shared middleware, routers, and global state to ``app``."""
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
add_exception_handlers(app)
|
|
add_middleware(app) |