Fastify rewrite URL
I am building a public API for our system using routes, and I want to set up a URL rewrite that rewrites the URL /docs to the latest version which is sitting in a folder called v1. So for example, if someone goes to the URL https://api.authentified.co/docs (which I am using AWS API Gateway to proxy the requests through to https://platform.authentified.co/REST/) I want it to rewrite to
v1/docs
.
I can't seem to do it with a Fastify plugin, as rewriting seems to only be available at the Factory level. https://fastify.dev/docs/latest/Reference/Server/#rewriteurl
At the moment it seems like a redirect is my only option, unless there's something I've missed?Server | Fastify
Factory
3 Replies