Skip to content

Instantly share code, notes, and snippets.

@petrosDemetrakopoulos
Last active January 19, 2021 08:22
Show Gist options
  • Save petrosDemetrakopoulos/65700b93512a725e1363a9483a9aa17d to your computer and use it in GitHub Desktop.
Save petrosDemetrakopoulos/65700b93512a725e1363a9483a9aa17d to your computer and use it in GitHub Desktop.
app.put('/user/:id/password', checkSchema({
id: {
// the location of the field can be one or more of 'body', 'cookies',
'headers', 'params' or 'query'.
// If omitted, all request locations will be checked
in: ['params','query'],
isInt: true,
errorMessage: 'ID is wrong'
},
password: {
isLength: {
errorMessage: 'Password should be at least 7 characters long',
options: {min: 7}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment