
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
server-router
Advanced tools
Performant radix-trie router for streaming servers.
var serverRouter = require('server-router')
var http = require('http')
var router = serverRouter({ default: '/404' })
router.route('GET', '/hello', function (req, res, params) {
res.end('hello world')
})
router.route('PUT', '/hello/:name', function (req, res, params) {
res.end('hi there ' + params.name)
})
router.route('', '/404', function (req, res, params) {
res.status = 404
res.end('404')
})
http.createServer(router.start()).listen()
Create a new router with opts.
Register a new route with an HTTP method name and a routename. Can register
multiple handlers by passing an array of method names. params
contains
matched partials from the route.
Match a route on a router.
Return a function that can be passed directly to http.createServer()
and
calls router.match()
.
$ npm install server-router
FAQs
Server router
The npm package server-router receives a total of 78 weekly downloads. As such, server-router popularity was classified as not popular.
We found that server-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.