Unverified Commit 02102063 authored by zhanweidu's avatar zhanweidu Committed by GitHub
Browse files

add switch to disable open api doc (#3744)


Signed-off-by: default avatarcongcongke <zhanweidu@163.com>
parent 7e944246
...@@ -84,6 +84,7 @@ from sglang.srt.utils import ( ...@@ -84,6 +84,7 @@ from sglang.srt.utils import (
add_api_key_middleware, add_api_key_middleware,
add_prometheus_middleware, add_prometheus_middleware,
delete_directory, delete_directory,
get_bool_env_var,
kill_process_tree, kill_process_tree,
set_uvicorn_logging_configs, set_uvicorn_logging_configs,
) )
...@@ -126,7 +127,10 @@ async def lifespan(fast_api_app: FastAPI): ...@@ -126,7 +127,10 @@ async def lifespan(fast_api_app: FastAPI):
# Fast API # Fast API
app = FastAPI(lifespan=lifespan) app = FastAPI(
lifespan=lifespan,
openapi_url=None if get_bool_env_var("DISABLE_OPENAPI_DOC") else "/openapi.json",
)
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["*"], allow_origins=["*"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment