Skip to content

fix(server): print localhost Swagger URL#710

Open
sarvesh1327 wants to merge 1 commit into
Lightning-AI:mainfrom
sarvesh1327:fix/localhost-swagger-url
Open

fix(server): print localhost Swagger URL#710
sarvesh1327 wants to merge 1 commit into
Lightning-AI:mainfrom
sarvesh1327:fix/localhost-swagger-url

Conversation

@sarvesh1327

Copy link
Copy Markdown

Summary

  • Print a browser-usable Swagger UI URL when LitServe binds to wildcard hosts.
  • Map 0.0.0.0 and :: to localhost for the user-facing docs link while keeping the actual bind host unchanged.
  • Add regression coverage for the display-host helper and the startup message.

Test Plan

  • .venv/bin/python -m pytest tests/unit/test_lit_server.py::test_disable_openapi_url_print_message -q (failed before the fix with http://0.0.0.0:8000/docs, passed after)
  • .venv/bin/python -m pytest tests/unit/test_lit_server.py::test_display_host_for_url_uses_browser_address tests/unit/test_lit_server.py::test_disable_openapi_url_print_message -q
  • uv run --with ruff ruff check src/litserve/server.py tests/unit/test_lit_server.py

Fixes #697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invalid ip address for windows during local debugging

1 participant