Skip to content

feat(server): add BASE_PATH environment variable support#2830

Open
rorychatt wants to merge 3 commits intomainfrom
claude/issue-2829-20260326-1624
Open

feat(server): add BASE_PATH environment variable support#2830
rorychatt wants to merge 3 commits intomainfrom
claude/issue-2829-20260326-1624

Conversation

@rorychatt
Copy link
Copy Markdown
Collaborator

Summary

  • Add BasePath property to ServerArgs record
  • Add --path-base CLI argument parsing
  • Add BASE_PATH environment variable support in Server constructor
  • Implement UsePathBase() middleware when BasePath is configured

Closes #2829

Generated with Claude Code

Add support for configuring the application base path via the BASE_PATH
environment variable, matching the pattern used for PORT, VERBOSE, and HOST.
This is useful for containerized deployments where env vars are preferred
over CLI arguments.

Changes:
- Add BasePath property to ServerArgs record
- Add --path-base CLI argument parsing
- Add BASE_PATH environment variable support in Server constructor
- Implement UsePathBase() middleware when BasePath is configured

Closes #2829

Co-authored-by: Mikael Rinne <rorychatt@users.noreply.github.com>
@rorychatt rorychatt marked this pull request as draft March 26, 2026 16:42
…th main

main already exposed ServerArgs.BasePath; the path-base feature branch added a
second property with documentation. Merging both produced CS0102.

Drop the redundant UsePathBase call that ran before forwarded headers; keep the
single registration after UseForwardedHeaders with logging.

Made-with: Cursor
@ArtemKhvorostianyi
Copy link
Copy Markdown
Collaborator

ArtemKhvorostianyi commented Mar 29, 2026

Removed duplicate BasePath and UsePathBase after merge with main
main already exposed ServerArgs.BasePath; the path-base feature branch added a
second property with documentation. Merging both produced CS0102.

Drop the redundant UsePathBase call that ran before forwarded headers; keep the
single registration after UseForwardedHeaders with logging.

Tested out, it works
image
image

@ArtemKhvorostianyi ArtemKhvorostianyi marked this pull request as ready for review March 29, 2026 13:25
@artem-ivy-ai
Copy link
Copy Markdown
Collaborator

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.

(base path): set via env

3 participants