New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http-contextual-dispatch

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

http-contextual-dispatch

Call a route function with a context

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

http-dispatch

Pass this function the result of a http routing lookup (of the format { value, args, query }) and have the value be a function, then it will call that function in a manner of fn(ctx, ...args, query, req). ctx can be any javascript Object.

Examples

http.createServer(function( request, response ){
	const match = route(request);
	// -> { value: { fn }, args, query }

	if (!match)
		return;	// probably send 404

	const result = dispatch(match, ctx, request);

	// probably send the result as a response
})
	.listen(8000);

FAQs

Package last updated on 29 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