Socket
Socket
Sign inDemoInstall

uri-template-route

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uri-template-route

Conditional Express middleware calls using RFC6570 URI Templates


Version published
Weekly downloads
68
decreased by-18.07%
Maintainers
1
Weekly downloads
 
Created
Source

uri-template-route

This package uses URI Templates for conditional middleware calls.

Usage

uri-template-route is a factory which returns new middlewares. Call it with a URI Template and the middleware function, which should be conditionally called. The template must be given as String or uri-templates object. If the request URL matches the template, the middleware function is called. Template variables will be assigned to req.params.

const uriTemplateRoute = require('uri-template-route')

const app = express()

app.use(uriTemplateRoute('/my-uri-template{?}', (req, res, next) => {
  // will be only called if req.url matches the template
  console.log(req.params)
})

Keywords

FAQs

Package last updated on 06 Nov 2017

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