Skip to content

SAMPLE 018: API base URL with a path prefix produces malformed routes - #939

Open
Young850 wants to merge 1 commit into
WHEELBACK:mainfrom
Young850:batch-118-features
Open

Young850 wants to merge 1 commit into
WHEELBACK:mainfrom
Young850:batch-118-features

Conversation

@Young850

Copy link
Copy Markdown
Contributor
  • Add API_PREFIX environment variable support for reverse proxy deployments
  • When API_PREFIX is set, all routes are nested under that prefix
  • Example: API_PREFIX=/api/v1 makes /invoices available at /api/v1/invoices
  • Properly handles path prefix with leading slash and trims trailing slash
  • Maintains backward compatibility - no prefix when API_PREFIX is empty

Implementation:

  • Split router into api_routes and conditionally nest under API_PREFIX
  • Supports clean deployment scenarios where API is behind a reverse proxy with path rewrite

Closes #864

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • PR description includes: Closes #[issue_id]
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

  • For contract changes, verify ABI snapshot hygiene with make check-abi-snapshots.
  • For UI changes, include screenshots or screen recordings to help reviewers.

- Add API_PREFIX environment variable support for reverse proxy deployments
- When API_PREFIX is set, all routes are nested under that prefix
- Example: API_PREFIX=/api/v1 makes /invoices available at /api/v1/invoices
- Properly handles path prefix with leading slash and trims trailing slash
- Maintains backward compatibility - no prefix when API_PREFIX is empty

Implementation:
- Split router into api_routes and conditionally nest under API_PREFIX
- Supports clean deployment scenarios where API is behind a reverse proxy with path rewrite
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@Young850 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

SAMPLE 018: API base URL with a path prefix produces malformed routes

1 participant