Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
simple router for journeyman module
JavaScript
branch: master
Failed to load latest commit information.
test Adds more robust matching on method
.gitignore
.travis.yml
README.md Add travis ci badge to README
example.js First pass
index.js
package.json
route.js

README.md

Rudder

Build Status

The simple little router for Journeyman

Example Usage

var Journeyman = require('journeyman');
var Rudder = require('./index');

var rudder = new Rudder();

function mw1(req, res, next) {
  res.write("HERE COMES THE MIDDLEWARE\n");
  next();
}

rudder.get(/^\/test\/(\d+)$/, mw1, function(req, res, number) {
  res.write(number + "\n");
  res.end();
});

var server = new Journeyman(3000);

server.use(rudder.middleware());

server.use(function(req, res, next) {
  res.write(req.url + "\n");
  res.write(req.method + "\n");
  next();
});

server.listen();
Something went wrong with that request. Please try again.