neuron-reverse-router
v1.1.1
Published
The opposite module of neuron-router to map a local file to a pathname
Downloads
7
Maintainers
Readme
neuron-reverse-router
Reverse router to map a local filename to a url path according to router configurations of neuron-dev-server.
Install
$ npm install neuron-reverse-router --save
Usage
routers:
[
{
location: '/mod',
root: '/home/my/.static_modules/'
},
{
location: '/old',
root: ['/data/public']
},
{
location: '/new',
root: ['/data'],
with_location: true
}
]
var rr = require('neuron-reverse-router');
rr.route('/data/public/a.js', routers); // '/old/a.js'
License
MIT