simple-rewrite
v0.0.1
Published
A simple request url rewriter as a minimal wrapper around String.prototype.replace
Downloads
3
Readme
simple-rewrite
A minimal wrapper around String.prototype.replace for request path rewriting
Example
'use strict';
var rewrite = require('simple-rewrite');
require('http')
.createServer(rewrite('/', '/blog', serveBlog));
function serveBlog (req, res) {
res.statusCode = 200;
res.end();
console.log(req.url);
}