INNER CODE UNIT · Python

run

cqzyys/lang-agent · lang-agent-backend/lang_agent/main.py:138

def run(host, port):
    # 初始化FastAPI
    app = FastAPI(title="Lang-Agent集成API", version="1.0.0", lifespan=lifespan)

    # 跨域配置
    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )

    @app.get("/")
    def docs():
        return RedirectResponse(url="/docs")

    @app.get("/health")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…