2.0.0 • Published 9 years ago

batch-me-if-you-can v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

batch-me-if-you-can

Build Status NPM version Code Climate Test Coverage

Batch request plugin for Hapi with simple configuration. Batch requests are ideal for applications with heavy mobile consumption since the latency associated with mobile networks makes multiple roundtrips expensive. This plugin works best when you use UUIDs as your primary keys. If you need path pipelining (using the result from one request to determine the path for the next) you should use bassmaster.

Setup

$ npm install batch-me-if-you-can inject-then
server.register(require('inject-then'), function (err) {
  if (err) throw err;
});
server.register({
  register: require('batch-me-if-you-can'),
  options: {}
}, function (err) {
  if (err) throw err;
});

Options

  • path (string, default='/batch'): The path for the batch route.
  • parallel (boolean, default=true): Global setting that determines whether batches are run in parallel or in series. Can be overriden by individual requests.

Usage

You can send POST requests containing JSON to the batch endpoint. Each request must contain at least a requests array with one request. Each request must define at least a path.

If an individual request results in an error, the serialized error body will be sent in the response. The status code of a request should be 200 regardless of the outcome of individual requests within the batch.

See the schema overview for more detail on the formatting of requests and replies.

2.0.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago