Repository navigation
修复 /setup 页面被 API 别名拦截:GET /setup 返回 405 - #129
Merged
todosdev[bot] merged 1 commit intoOct 18, 2026
Merged
Conversation
- drop app.route('/setup', setupRoutes); /setup is now SPA-only
- keep /api/setup routes (POST /, GET /state, GET /* 405) unchanged
- update setup tests and README/README.zh-CN/CLAUDE docs accordingly
Checkpoint: Tbu9TOL8fykR0LXO-GSor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /setupwas being swallowed by the setup router'sGET /*405 fallback, so the SPA initialization page (added in chore(deps): update pnpm/action-setup action to v6 #13) could never load — production returned 405 JSON./setupbackward-compatible API alias so/setupserves only the SPA page; the setup API stays exclusively under/api/setup(no historical compatibility retained).Changes
apps/worker/src/index.ts— droppedapp.route('/setup', setupRoutes), keeping onlyapp.route('/api/setup', setupRoutes);/setupnow falls through the reserved-slug check to the SPA fallback.apps/worker/src/routes/setup.ts— unchanged; internal paths (GET /state,GET /*405,POST /) remain as-is and only mount under/api/setup.apps/worker/test/setup.test.ts— removed thePOST /setupalias andGET /setup/*405 tests; added aGET /setuptest asserting a 200 SPA response withtext/html(not JSON). All/api/setup/*and/api/admin/setuptests remain.CLAUDE.md,README.md,README.zh-CN.md— removed the(legacy alias /setup)wording and documented that the initialization page lives at/setupwhile the API isPOST /api/setup,GET /api/setup/state, andPOST /api/admin/setup.Testing
pnpm check(biome),pnpm typecheck,pnpm build, andpnpm testall pass.wrangler devverification:GET /setup→ 200text/htmlSPA HTML;POST /api/setupon a fresh D1 → 200 with both migrationsapplied;GET /api/setup/state→{"enabled":true};GET /api/setup/*→ 405 withAllow: POST.