Skip to content

Comments

fix: prevent duplicate basePath appending in subapps#37

Merged
remorses merged 1 commit intomainfrom
claude/issue-34-20250710_080419
Jul 10, 2025
Merged

fix: prevent duplicate basePath appending in subapps#37
remorses merged 1 commit intomainfrom
claude/issue-34-20250710_080419

Conversation

@remorses
Copy link
Owner

Fixes #34

Prevent duplicate basePath appending when a subapp has the same basePath as its parent app.

Changes

  • Added joinBasePaths() method that filters out consecutive duplicate basePaths
  • Updated getAllRoutes() and match() methods to use the new logic
  • Added comprehensive test with inline snapshots

Test Coverage

  • Validates that parent app with basePath /api and subapp with same basePath results in /api/users not /api/api/users
  • Tests nested scenarios work correctly
  • Verifies getAllRoutes() returns correct deduplicated paths

Generated with Claude Code

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
spiceflow-website-worker c803954 Jul 10 2025, 08:10 AM

@remorses remorses merged commit 7f5f33a into main Jul 10, 2025
0 of 3 checks passed
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.

Do not append subapp basePsth if it is the same as parent app

1 participant