Commit d5052c6
authored
feat: redirect vp-setup.void.app to setup.viteplus.dev (#4)
## Summary
- Added global Void middleware at
`middleware/01.redirect-to-custom-domain.ts` that issues a 301 redirect
from the default `vp-setup.void.app` host to the canonical custom domain
`https://setup.viteplus.dev`, preserving path and query string
- Other hosts (custom domain itself, `localhost` during dev, any
preview/staging subdomains) pass through untouched
- Exported a pure `buildRedirectTarget()` helper so the logic is
unit-testable without spinning up Hono
## Test plan
- [x] `vp test` — 30 tests pass (6 new in `tests/redirect.test.ts`)
- [x] `vp check` — clean (format, lint, type-check)
- [ ] After merge + deploy:
- [ ] `curl -I https://vp-setup.void.app/` returns `301` with `Location:
https://setup.viteplus.dev/`
- [ ] `curl -IL 'https://vp-setup.void.app/?tag=v1.2.3&arch=arm64'`
preserves query and lands on 200
- [ ] `curl -I https://setup.viteplus.dev/` returns `200` (no redirect
loop)
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent dce6cef commit d5052c6
2 files changed
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments