sails-hook-route
Laravel-like route function for Sailsjs.
Installation
$ npm install sails-hook-route
How to use
- In your config/routes.js file, add a name property for a route you want to be named :
// Some routes'GET /foo/:id': name: 'foo' controller: 'SomeController' action: 'bar'// Some routes
- In your template file :
<a href="<%= route('foo', 5) %>">Foo</a>
and it will produce
Foo