Simplified and fast routing for your server without an accompanying framework.
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.
npm install pipeline-router
This example is in the tests folder. Here is a simple http router.
var http = require'http'Router = require'pipeline-router';var routerFactory =var router = ;routerparam'zip' /zip-/;routerparam'item' //;routerget'/foo/:zip/:item'reswriteHead200 'Content-Type': 'application/json' ;reswriteJSONstringifyreqparams;resend;;routerget'/'reswrite"Home";resend;;return router;;var server = httpcreateServervar router = routerFactorycreate;routerdispatchreq res;;serverlisten3000;