Skip to content

feat(kamado): add proxy support for dev server#108

Merged
yusasa16 merged 10 commits intodevfrom
feat/kamado-dev-server-proxy-v2
Apr 10, 2026
Merged

feat(kamado): add proxy support for dev server#108
yusasa16 merged 10 commits intodevfrom
feat/kamado-dev-server-proxy-v2

Conversation

@yusasa16
Copy link
Copy Markdown
Collaborator

@yusasa16 yusasa16 commented Apr 3, 2026

Summary

  • Add devServer.proxy option to forward requests to external servers during development, avoiding CORS issues for AJAX calls
  • Support string shorthand ('/api': 'https://example.com') and object form with pathRewrite / changeOrigin
  • Longer path prefixes are matched first to prevent routing conflicts
  • Add comprehensive Proxy API documentation to README.md and README.ja.md

Test plan

  • Configure proxy and verify request forwarding
  • Verify pathRewrite / changeOrigin behavior
  • Run yarn build and confirm no type errors

🤖 Generated with Claude Code

yusasa16 and others added 2 commits April 3, 2026 11:08
Add proxy configuration to DevServerConfig that forwards requests
to external servers during development, avoiding CORS issues.
Supports string shorthand and object form with path rewriting.
Longer path prefixes are matched first to prevent routing conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yusasa16 yusasa16 requested a review from YusukeHirao as a code owner April 3, 2026 02:09
@yusasa16 yusasa16 marked this pull request as draft April 3, 2026 02:38
@yusasa16 yusasa16 self-assigned this Apr 3, 2026
Align with http-proxy convention where changeOrigin defaults to false.
Update JSDoc and README to describe when to use changeOrigin: true
without implying it is recommended.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yusasa16 yusasa16 marked this pull request as ready for review April 6, 2026 02:24
yusasa16 and others added 4 commits April 6, 2026 11:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…helpers

- Strengthen assertions: toContain → exact URL match, add toHaveBeenCalledOnce
- Add origin: null assertion for changeOrigin: false
- Add method assertion for POST body forwarding test
- Add tests: query string preservation, exact prefix match
- Export and unit test normalizeRule and hasBody

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yusasa16 yusasa16 changed the base branch from main to dev April 10, 2026 02:17
@yusasa16 yusasa16 merged commit 8f64fe2 into dev Apr 10, 2026
1 check passed
@yusasa16 yusasa16 deleted the feat/kamado-dev-server-proxy-v2 branch April 10, 2026 02:47
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.

2 participants