Skip to content

Commit

Permalink
fix warning: 'You are accessing the deprecated "request.routerPath" p…
Browse files Browse the repository at this point in the history
…roperty. Use "request.routeOptions.config.url" instead. Property "req.routerPath" will be removed in `fastify@5`.' (#388)
  • Loading branch information
jkenda authored Sep 11, 2023
1 parent ac79a9e commit 8f443d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function fastifyView (fastify, opts, next) {
}

function getRequestedPath (fastify) {
return (fastify && fastify.request) ? fastify.request.routerPath : null
return (fastify && fastify.request) ? fastify.request.routeOptions.config.url : null
}
// Gets template as string (or precompiled for Handlebars)
// from LRU cache or filesystem.
Expand Down

0 comments on commit 8f443d4

Please sign in to comment.