Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
02102063
Unverified
Commit
02102063
authored
Apr 27, 2025
by
zhanweidu
Committed by
GitHub
Apr 26, 2025
Browse files
add switch to disable open api doc (#3744)
Signed-off-by:
congcongke
<
zhanweidu@163.com
>
parent
7e944246
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
python/sglang/srt/entrypoints/http_server.py
python/sglang/srt/entrypoints/http_server.py
+5
-1
No files found.
python/sglang/srt/entrypoints/http_server.py
View file @
02102063
...
@@ -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
=
[
"*"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment