E.g. need to pass options for an auth-Route with rate limit (https://github.com/fastify/fastify-rate-limit)
Need to add addtional middlewares to a specific route.
I did not find anything in the docs or src/tests about that.
Example from fastify-rate-limit
fastify.get('/public/sub-rated-1', {
config: {
rateLimit: {
timeWindow: '1 minute',
allowList: ['127.0.0.1'],
onExceeding: function (request, key) {
console.log('callback on exceededing ... executed before response to client')
},
onExceeded: function (request, key) {
console.log('callback on exceeded ... to black ip in security group for example, request is give as argument')
}
}
}
}, (request, reply) => {
reply.send({ hello: 'from sub-rated-1 ... using default max value ... ' })
})
How can this be done with a fastify.zod.post?
E.g. need to pass options for an auth-Route with rate limit (https://github.com/fastify/fastify-rate-limit)
Need to add addtional middlewares to a specific route.
I did not find anything in the docs or src/tests about that.
Example from fastify-rate-limit
How can this be done with a
fastify.zod.post?