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

pipeline-router

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pipeline-router

Simplified and fast routing for your server without an accompanying framework.

  • 1.1.8
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

router

Node.js module for simplifying http routing for your server without having to sign up for the accompanying framework.

This project strives to be a straight forward routing solution for common http applications where you need to parse urls and then activate some chain of logic. Many other options either come with a much bigger framework or are trying to solve a bigger problem (like client side routing).

This routing module is targeted for speed hungry people that want to be closer to the metal. If you are not that type of person, then use express.js.

browser support

travis-ci status

Install

npm install pipeline-router

Example

This example is in the tests folder. Here is a simple http router.

var http = require('http'),
	Router = require('pipeline-router');

var routerFactory = {
	create: function() {
		var router = new Router();

		router.param('zip', /zip-(\d{5})/);
		router.param('item', /(\w*)/);

		router.get('/foo/:zip/:item', function(req, res) {
			res.writeHead(200, { 'Content-Type': 'application/json' });
	        res.write(JSON.stringify(req.params));
	        res.end();
		});

		router.get('/', function(req, res) {
			res.write("Home");
			res.end();
		});

		return router;
	}
};

var server = http.createServer(function (req, res) {
	var router = routerFactory.create();

	router.dispatch(req, res);

});

server.listen(3000);

Keywords

FAQs

Package last updated on 20 Feb 2014

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