Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

chrisns/sails-reverse-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sails-reverse-routing

Greenkeeper badge

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

About

Sails reverse routing lookup

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published