<commit_before>hapi.js helpers
===============

[![Build Status](https://travis-ci.org/rsp/node-hapi-helpers.svg?branch=master)](https://travis-ci.org/rsp/node-hapi-helpers)
[![Test Coverage](https://coveralls.io/repos/rsp/node-hapi-helpers/badge.svg?branch=master)](https://coveralls.io/r/rsp/node-hapi-helpers?branch=master)

[https://github.com/rsp/node-hapi-helpers](https://github.com/rsp/node-hapi-helpers)
([readme](https://github.com/rsp/node-hapi-helpers#readme))

Some helper functions for [hapi.js](http://hapijs.com/) to write less boilerplate code.
Currently simplify routes definitions.

Example
-------
You can write:
```js
server.addRoutes([
    get('/a/{id}', getA),
    del('/a/{id}', delA),
    route('get put post delete', '/b', handleB)
]);
```
Instead of:
```js
server.addRoutes([
    {
        method: 'GET',
        path: '/a/{id}',
        handler: getA
    },<commit_msg>Add info to readme<commit_after>hapi.js helpers
===============

[![Build Status](https://travis-ci.org/rsp/node-hapi-helpers.svg?branch=master)](https://travis-ci.org/rsp/node-hapi-helpers)
[![Test Coverage](https://coveralls.io/repos/rsp/node-hapi-helpers/badge.svg?branch=master)](https://coveralls.io/r/rsp/node-hapi-helpers?branch=master)

[https://github.com/rsp/node-hapi-helpers](https://github.com/rsp/node-hapi-helpers)
([readme](https://github.com/rsp/node-hapi-helpers#readme))

Some helper functions for [hapi.js](http://hapijs.com/) to write less boilerplate code.

Currently it only simplifies the routes definitions.
Feature requests welcome via [issues](#issues).

It has no dependencies - only some devDependencies: it uses
[chai](https://github.com/chaijs/chai),
[mocha](https://github.com/mochajs/mocha),
[istanbul](https://github.com/gotwarlost/istanbul) and
[coveralls](https://github.com/cainus/node-coveralls)
for testing and test coverage,
and [Travis](https://travis-ci.org/) for continuous integration,
see: [https://travis-ci.org/rsp/node-hapi-helpers](https://travis-ci.org/rsp/node-hapi-helpers))

Example
-------
You can write:
```js
server.addRoutes([
    get('/a/{id}', getA),
    del('/a/{id}', delA),
    route('get put post delete', '/b', handleB)
]);
```
Instead of:
```js
server.addRoutes([
    {
        method: 'GET',
        path: '/a/{id}',
        handler: getA
    },
{'fraction_non_alphanumeric': 0.21187175043327555, 'fraction_numerical': 0.0, 'mean_word_length': 4.165548098434004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 21, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '692119', 'n_tokens_mistral': 832, 'n_tokens_neox': 849, 'n_words': 133}