Skip to content
Very simple HTTP router for node.js
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Readme.md
index.js
package.json

Readme.md

rtr - a very simple http router

A basic router which has support for named parameters in URLs and regexes.

Example usage:

var Router = require('rtr'),
    http = require('http'),
    router, server;

router = new Router();
router.get('/', function(req, res) {
    res.writeHead(200);
    res.end('Hello World');
});

router.get('/hello/:name', function(req, res, name) {
    res.writeHead(200);
    res.end('Hello ' + name);
});

server = http.createServer(router.dispatch);

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