Skip to content

Instantly share code, notes, and snippets.

@singh1114
Last active May 10, 2020 20:54
Show Gist options
  • Save singh1114/e33ef5764df3476bf7a6c83cf3e9359d to your computer and use it in GitHub Desktop.
Save singh1114/e33ef5764df3476bf7a6c83cf3e9359d to your computer and use it in GitHub Desktop.
schema for route parameter validation middleware.
router.post('/abc', validateParams([
{
param_key: 'abc',
required: true,
type: 'string',
validator_functions: [(param) => {return param.length === 10}]
}]), routeFunction);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment