Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
osprey-router
Advanced tools
Simple middleware-style router for RAML based on router.
npm install osprey-router --save
This module is an instance of router with support for RAML paths and parameters.
All options and functions from router are supported, except the second argument can be an optional array of webapi-parser Parameter
objects. For example:
const finalhandler = require('finalhandler')
const http = require('http')
const Router = require('osprey-router')
const utils = require('./utils')
const router = Router()
const parameters = utils.getUriParameters()
router.get('/{userId}', parameters, function (req, res) {
console.log(typeof req.params.userId)
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(req.params.userId)
})
const server = http.createServer(function (req, res) {
router(req, res, finalhandler(req, res))
})
server.listen(3000)
When you specify the parameter type, it'll automatically be parsed in the native JavaScript type.
Apache 2.0
FAQs
Simple middleware-style router for RAML based on router
The npm package osprey-router receives a total of 479 weekly downloads. As such, osprey-router popularity was classified as not popular.
We found that osprey-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.