Logo: Relish

  1. Sign up
  2. Sign in

Project: Gavel 0.1

  • Change version

    1. 0.1

Node.js library examples

GAVEL—JavaScript library for HTTP validation

Build Status Dependency Status
devDependency Status Coverage Status

Gavel logo

Usage

var gavel = require('gavel');
response = {
  "statusCode": "200",
  "headers": {
    "content-type": "application/json",
    "date": "Wed, 03 Jul 2013 13:30:53 GMT",
    "server": "gunicorn/0.17.4",
    "content-length": "30",
    "connection": "keep-alive"
  },
  "body": "{\n  \"origin\": \"94.113.241.2\"\n}"
};
expected = {
  "statusCode": "200",
  "headers": {
    "content-type": "application/json",
    "date": "Wed, 03 Jul 2013 13:30:53 GMT",
    "server": "gunicorn/0.17.4",
    "content-length": "30",
    "connection": "keep-alive"
  },
  "body": "{\n  \"origin\": \"94.113.241.2\"\n}"
};
gavel.isValid(response, expected, 'response', function(error,result){
  console.log result;
});

Installation

npm install gavel

Resources

Development

$ git clone [email protected]:apiaryio/gavel.js.git
$ cd gavel.js
$ git submodule init
$ git submodule update
$ npm install
$ npm test

Codo API documentation is published with use of Github post-receive hook

This README.md is generated by build script in [./scripts/build] from Gavel's Cucumber documentation repository

Topics

  1. Response Async API
  2. Response Sync API
  3. Request Async API
  4. request Sync API

Last published 4 months ago by Adam Kliment.