dialexa / relish

Better error messages for Hapi.js Joi validation
https://npmjs.com/package/relish
ISC License
121 stars 17 forks source link

how to use relish in a express application #11

Closed sergio11 closed 8 years ago

sergio11 commented 8 years ago

Relish could be used on a express aplication with express validation middleware?

If it is not possible, Could you suggest me an alternative?

Greetings and thank you.

galenandrew commented 8 years ago

@sergio11 are you currently using Joi for validation in your express application?

sergio11 commented 8 years ago

yes, I am developing a proyect based on this boilerplate KunalKapadia/express-mongoose-es6-rest-api. In which it is used express-validation and JOI for API parameter validation.

how could employ relish here?

galenandrew commented 8 years ago

@sergio11 nice!

Relish (in it's current state) is tightly coupled to the Hapi framework and its route option's failAction. This means that Relish is not compatible with Express at the moment.

I would recommend checking out Joi's any.error option for setting custom errors on a Joi schema.