express-reroute

1.0.2 • Public • Published

express-reroute

Rewrite middleware for express 3.0 ,using xregexp's named syntax

Usage

Require it:

var reroute = require('express-reroute');

Define a rerwrite table:

var rewriteTable = [
    { 'from' : '/assets/(?<op>\\w+)', 'to' : '/vatican/assets/${op}' }, //... etc
    ];

And use it:

app.use(reroute(rewriteTable));

Rewrite table uses XRegExp's Named syntax. Enjoy.

XRegExp Syntax: http://xregexp.com/syntax/

Readme

Keywords

none

Package Sidebar

Install

npm i express-reroute

Weekly Downloads

0

Version

1.0.2

License

none

Last publish

Collaborators

  • terryfe