check-params
Validates url, body, and query parameters for Express
Please ★ this repo if you found it useful ★ ★ ★
Features
- Check body params
- Check query params
- Check url params
Installation
$ npm install --save check-params
Dependencies
Usage
var checkParams = ; moduleexports = { ; };
Now, if I enter the following url . . .
http://myserver.com/example?hello=world&foo=bar
. . . I get the following response.
However, if I enter the following url, without the query params . . .
http://myserver.com/example
. . . I get the following response.
If you do not put in the required parameters, you will get a response asking for them.
More Details
The checkParams function recieves three properties. The last property, options, is optional.
;
The checkParams function always returns as a promise. It is also good to note, that the err response has a property called code. This contains the suggested response status code.
Support
Submit an issue
Buy Me Coffee
A ridiculous amount of coffee was consumed in the process of building this project.
Add some fuel if you'd like to keep me going!
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
Jam Risser © 2017
Credits
- Jam Risser - Author
Changelog
0.3.0 (2017-06-28)
- Removed message response
0.1.0 (2016-10-25)
- Beta release