cl-aaron
cl-aaron
You can save and reuse complex types. ``` var Truthy = Joi.any().invalid("",0,null,false,NaN,undefined); var schema = Truthy; schema.validate({}, cb) //yes var schema2 = Truthy; schema2.validate(false, cb) //no ```
However, representing Falsy is actually trickier than I first thought. ``` Falsy = Joi.any().allow("",0,null,false,NaN,undefined); //doesn't work correctly Falsy.validate(null) //returns valid Falsy.validate(undefined) //returns valid Falsy.validate(true) //returns valid but shouldn't Falsy.validate({}) //returns...
Thanks for your reply, I tried to use that but it was a mostly empty object that didn't contain the route specific plugin settings. I am on an older version...
I'm adding route specific rate limiting information to the route definition. For example this is a raw route object that is passed into the server.route method ``` { method: 'GET',...
That was it. I got it working onPreAuth without _router. Thanks!
I can make it available but I wrote it for an older version of Hapi so it will need a bit of updating. It is a small plugin luckily.
Alright here it is, https://www.npmjs.org/package/hapi-ratelimit . Very basic but it works.
Awesome, thanks!