A Node.js API gateway that just works!
Fix an issue on the cache plugin that caused double proxy calls.
If redis
cache is used, then keys pattern
are used for retrieval. This will avoid fetching unrequired keys from the remote redis instance.
Fixes double response stream reading issue.
middlewares
, pathRewrite
and hooks
optional config properties.pathRegex
value.Allowing request url overwrite before proxy:
routes: [{
pathRegex: '',
prefix: '/user/:id/details',
methods: ['GET'],
prefixRewrite: '',
target: 'http://localhost:3000',
middlewares: [],
hooks: {
async onRequest (request, reply) {
request.req.url = `/userdetails/${request.params.id}`
}
}
}]
Fix: https://github.com/jkyberneees/fastify-gateway/issues/21
Added:
Thanks @Betank for your contribution here!
Required update due a breaking change in fastify-reply-from v0.6.x