connect-action
A simple named action system for Connect
Install
$ npm install connect-action
Usage
var connect = ;var connectAction = ; var pages = "/": action: 'root' "/login": action: 'login' body: 'Login page' ; var actions = ; actions; actions; var app = ;app;app;
Helper functions
The connect-action module adds a couple of helper functions onto the request and response objects
// attempt to find a url for a given action:
req.resolve.action('action-name');
// if a redirect function exists, you can also redirect to actions:
res.redirect.action('action-name');