Skip to content

feat: fix the parse#122

Closed
bedus-creation wants to merge 2 commits into
mainfrom
fastapi-serve-command
Closed

feat: fix the parse#122
bedus-creation wants to merge 2 commits into
mainfrom
fastapi-serve-command

Conversation

@bedus-creation

Copy link
Copy Markdown
Contributor

No description provided.

bedus-creation and others added 2 commits June 13, 2026 10:29
…eld, test all priority scenarios

Replace the broken `resolve_option`+`resolve_url` pair with a single clear
`resolve_host_port()` method that walks three layers in order:
  APP_URL → APP_HOST/APP_PORT → CLI --host/--port.

The old `resolve_option` called `env(value)` with an already-resolved value
(e.g. "127.0.0.1" or 8000), which made `os.getenv("127.0.0.1")` return ""
and silently dropped every configured value.  The new method reads each layer
with a plain `Config.get()` call and conditionally overrides, so the intent
is readable without any intermediate abstraction.

`FastAPIConfig` gains an `app_url` field (reads APP_URL env var) and its
`host`/`port` fields now default to empty/"" / 0 so they don't shadow APP_URL
when the user hasn't set APP_HOST/APP_PORT.

`tests/fastapi/test_serve_command.py` is added with 17 cases covering every
combination: defaults, APP_URL host+port, bare host without scheme, no-port
fallback, no-host fallback, APP_HOST/APP_PORT overrides, and CLI overrides.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedus-creation bedus-creation deleted the fastapi-serve-command branch June 13, 2026 18:22
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.

1 participant