sails-hook-route

0.0.8 • Public • Published

sails-hook-route

NPM version

Laravel-like route function for Sailsjs.

Installation

$ npm install sails-hook-route

How to use

  1. 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
}
  1. In your template file :
<a href="<%= route('foo', 5) %>">Foo</a>

and it will produce

<a href="/foo/5">Foo</a>

Package Sidebar

Install

npm i sails-hook-route

Weekly Downloads

2

Version

0.0.8

License

MIT

Unpacked Size

4.91 kB

Total Files

5

Last publish

Collaborators

  • melchyore