apply as middleware inside your public routes or any route you want to limit
Need to Add " bruteforce.prevent" before createService()
// Initializes the `contact-us` service on path `/contact-us`const { createService } =require('feathers-mongoose-casl');constcreateModel=require('../../models/contact-us.model');consthooks=require('./contact-us.hooks');constbruteforce=require('../../utils/requestLimitMiddleware');module.exports=function (app) {constModel=createModel(app);constpaginate=app.get('paginate');constoptions= { Model, paginate, serviceRules: [ {'actions': ['create'],'anonymousUser':true} ], };// Initialize our service with any options it requiresapp.use('/contact-us',bruteforce.prevent,// Limit user requestcreateService(options) );// Get our initialized service so that we can register hooksconstservice=app.service('contact-us');service.hooks(hooks);};