neuron-reverse-router

1.1.1 • Public • Published

Build Status

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

Dependents (1)

Package Sidebar

Install

npm i neuron-reverse-router

Weekly Downloads

3

Version

1.1.1

License

MIT

Last publish

Collaborators

  • kael