Nocebo express request validator.
npm install nocebo-express-request-validatorHandles schema validation on express request.
Needs harmony to be set when used:
node --harmony
Options:
schema.body: String | JSON Schema
schema.query: String | JSON Schema
Example:
{
schema: {
body: {
"type": "object",
"properties": {
"title": {
"type": "string"
}
},
"required": ["title"]
},
query: {
{
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"]
}
}
}
}
To run unit tests:
npm test