Module helpers
A collection of helper functions that makes working with Stick middleware easier.
Functions
- linkTo (app, bindings, text)
- redirectTo (app, bindings)
- resolveApp (app)
- urlFor (app, bindings)
linkTo (app, bindings, text)
Return a link to an action configured using the route
middleware.
The link's URL is generated from the bindings argument as described for the urlFor helper.
Parameters
object|string | app | the application to link to |
object | bindings | an object containing the bindings for the target URL. |
string | text | the link text. |
redirectTo (app, bindings)
Create a response that redirects the client to a different URL.
Parameters
string|object | app | either the URL as string or an app
to be passed to |
bindings | bindings | to pass to |
Returns
object | a JSGI response that will redirect the client to the specified target |