MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / init_app

Function init_app

server/bootstrap.py:13–32  ·  view source on GitHub ↗

Apply shared middleware, routers, and global state to ``app``.

(app: FastAPI)

Source from the content-addressed store, hash-verified

11
12
13def init_app(app: FastAPI) -> None:
14 """Apply shared middleware, routers, and global state to ``app``."""
15
16 app.add_middleware(
17 CORSMiddleware,
18 allow_origins=["*"],
19 allow_credentials=True,
20 allow_methods=["*"],
21 allow_headers=["*"],
22 )
23
24 add_exception_handlers(app)
25 add_middleware(app)
26
27 state.init_state()
28
29 for router in ALL_ROUTERS:
30 app.include_router(router)
31
32 app.include_router(config_schema_router)

Callers 1

app.pyFile · 0.90

Calls 2

add_exception_handlersFunction · 0.90
add_middlewareFunction · 0.90

Tested by

no test coverage detected