1.0.3 • Published 7 years ago

nocebo-express-request-validator v1.0.3

Weekly downloads
4
License
UNLICENCED
Repository
github
Last release
7 years ago

Nocebo Express Request Validator

Handles schema validation on express request.

Requirements

Needs harmony to be set when used:

node --harmony

Setup

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"]
      }
    }
  }
}

Test

To run unit tests:

npm test
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago