Last active
May 10, 2020 20:54
-
-
Save singh1114/e33ef5764df3476bf7a6c83cf3e9359d to your computer and use it in GitHub Desktop.
schema for route parameter validation middleware.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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