Replace the APIs Fastify 5 removed

Proprietary

Replace reply.getResponseTime() with reply.elapsedTime, request.connection with request.socket, request.routeConfig, routeSchema, routerPath and routerMethod with the matching request.routeOptions property, and reply.redirect(statusCode, url) with reply.redirect(url, statusCode). Only files that import or require fastify change, and only on the first two parameters of a function when they are named request or req, then reply or res.

org.openrewrite.nodejs.migrate.fastify.ReplaceRemovedFastifyApis
mod run . --recipe=org.openrewrite.nodejs.migrate.fastify.ReplaceRemovedFastifyApis

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.