Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

osprey-resources

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osprey-resources

Automatically support RAML resources

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
555
decreased by-21.83%
Maintainers
3
Weekly downloads
 
Created
Source

Osprey Resources

NPM version NPM Downloads Build status Test coverage Greenkeeper badge

Iterate over RAML resources and generate a middleware router.

Installation

npm install osprey-resources --save

Usage

const express = require('express')
const resources = require('osprey-resources')
const utils = require('./utils')

const app = express()

// Array.<webapi-parser.EndPoint>
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.

License

MIT license

FAQs

Package last updated on 28 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc