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
0 executions
1 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

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.