Automatically support RAML resources
npm install osprey-resources[![NPM version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]

Iterate over RAML resources and generate a middleware router.
```
npm install osprey-resources --save
`js
const express = require('express')
const resources = require('osprey-resources')
const utils = require('./utils')
const app = express()
// Array.
const endPoints = utils.getEndPoints()
app.use(resources(
endPoints,
function (method, path) {
return function (req, res, next) {
res.end('hello, world!')
}
}
))
`
The resources function accepts two arguments. The array of EndPoint objects from webapi-parser model and a function that will generate the route for that path. Return null` if the route should not be used.
MIT license
[npm-image]: https://img.shields.io/npm/v/osprey-resources.svg?style=flat
[npm-url]: https://npmjs.org/package/osprey-resources
[downloads-image]: https://img.shields.io/npm/dm/osprey-resources.svg?style=flat
[downloads-url]: https://npmjs.org/package/osprey-resources
[travis-image]: https://img.shields.io/travis/mulesoft-labs/osprey-resources.svg?style=flat
[travis-url]: https://travis-ci.org/mulesoft-labs/osprey-resources
[coveralls-image]: https://img.shields.io/coveralls/mulesoft-labs/osprey-resources.svg?style=flat
[coveralls-url]: https://coveralls.io/r/mulesoft-labs/osprey-resources?branch=master