Fastify/5/Redirect Arg Order

/icons/calendar.svg

Last update

Sep 17, 2024

This codemod updates reply.redirect by placing the status code as the second argument, as per Fastify v5 conventions.

Before

reply.redirect(301, '/new-route');

After

reply.redirect('/new-route', 301);

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now