0.0.1 • Published 11 years ago
simple-rewrite v0.0.1
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);
}
0.0.1
11 years ago