simple-rewrite

0.0.1 • Public • Published

simple-rewrite

Build Status Coverage Status

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);
}

Package Sidebar

Install

npm i simple-rewrite

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • omsmith