Answers for "node js rate limiter fastify"

0

node js rate limiter fastify

npm i fastify-rate-limit

const fastify = require('fastify')()

fastify.register(require('fastify-rate-limit'), {
  max: 100,
  timeWindow: '1 minute'
})

fastify.get('/', (request, reply) => {
  reply.send({ hello: 'world' })
})

fastify.listen(3000, err => {
  if (err) throw err
  console.log('Server listening at http://localhost:3000')
})
Posted by: Guest on April-17-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language