[routeRules] Support `redirect: '<path> <statusCode>'` alias
Open
Nobody has claimed this yet.
dx
enhancement
v2
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
It would be nice to support:
'/get-started': { redirect: '/get-started/installation 301' },
// Similar to
'/get-started': { redirect: { to: '/get-started/installation', statusCode: 301 } },
I believe it could be done here: https://github.com/unjs/nitro/blob/11a241244a166b0733b924d16ce5a32e1be89005/src/options.ts#L419
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/options.ts around line 419 and trace how routeRules redirect values are parsed or normalized. Confirm the string form accepts a path followed by a status code, matching the object form shown in the issue; done means both forms produce equivalent redirects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100