Eexpressjs

expressjs/redirect-arg-order

Migrates usage of the legacy APIs `res.redirect(url, status)` to use the recommended argument order `res.redirect(status, url)`.

transformationmigrationexpressredirectlocation
Public
40 executions
Run locally
npx codemod @expressjs/redirect-arg-order
Documentation

Migrate legacy res.redirect(url, status)

Migrates usage of the legacy APIs res.redirect(url, status) to the new signature
res.redirect(status, url). This usage was deprecated in Express 4, in Express 5 you must use the new signature res.redirect(status, url).

Example

Migrating res.redirect(url, status)

The migration involves replacing instances of res.redirect(url, status) with res.redirect(status, url).

diff

References

Ready to contribute?

Build your own codemod and share it with the community.