sails-reverse-routing

1.0.15 • Public • Published

sails-reverse-routing

Build Coverage Quality Dependencies

Ability to generate a uri given controller, action and arguments

Install

$ npm install sails-reverse-routing

Usage

Call reverseRouteService() anywhere like so:

   var arguments = [arg1, arg2];
   var components =  { controller: "someController.someMethod", args: arguments };
   var absoluteUrl = true;
   var link = reverseRouteService(components, absoluteUrl);

Set absoluteUrl to false to get a relative URI. The return value is an object with a 'uri' and a 'verb' property.

Tests

$ npm install
$ npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.15
    4
    • latest

Version History

Package Sidebar

Install

npm i sails-reverse-routing

Weekly Downloads

9

Version

1.0.15

License

MIT

Last publish

Collaborators

  • chrisns
  • ollienilsen