An Express wrapper library that provides enhanced routing and controller handling.
Installation
$ npm install shack
Use just like express
var shack = ;var app = ; app; app;
Define routes in a dedicated JSON file
"get /users": "action":"users" "post /users/:id": "action":"users:update" "put /users/:id": "action":"users:create"
Define controllers with actions instead of routes
var ctrl = ; // A default "index" action is always created ctrlaction'create' { // Save user User;}; modulesexports = ctrl;
Features
- Build on Express
- Elegant, dedicated routing file
- Controller pattern focused on actions instead of specifically http requests
- Sensible defaults for common behaviors
- Easily default whole controllers or actions to JSON
- "before" and "after" handlers for common pre- or post-action behaviors