Skip to content

Instantly share code, notes, and snippets.

@edwin-bluekite
Created February 18, 2014 18:07
Show Gist options
  • Save edwin-bluekite/9076327 to your computer and use it in GitHub Desktop.
Save edwin-bluekite/9076327 to your computer and use it in GitHub Desktop.
Hapi Joi field validation
//Route
{
method: 'GET',
path: '/{version}/services/{path*}',
config:{
handler: {
proxy: {
mapUri: controller.payments.mapper ,
passThrough: true,
redirects: 2,
// postResponse: postResponse
}
},
validate:{
path: {
version: lib.Joi.string().regex(/v[\d]+/)
}
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment