Socket
Socket
Sign inDemoInstall

express-resource

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-resource - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

5

History.md
0.2.3 / 2011-09-23
==================
* Fixed logic to allow actions to be defined in any order [Wompt]
0.2.2 / 2011-09-08

@@ -3,0 +8,0 @@ ==================

18

index.js

@@ -16,4 +16,13 @@

, lingo = require('lingo')
, en = lingo.en;
, en = lingo.en
, orderedActions = [
'index' // GET /
,'new' // GET /new
,'create' // POST /
,'show' // GET /:id
,'edit' // GET /edit/:id
,'update' // PUT /:id
,'destroy'// DEL /:id
];
/**

@@ -40,4 +49,5 @@ * Initialize a new `Resource` with the given `name` and `actions`.

// default actions
for (var key in actions) {
this.mapDefaultAction(key, actions[key]);
for (var i=0, key; i < orderedActions.length; i++) {
key = orderedActions[i];
if (actions[key]) this.mapDefaultAction(key, actions[key]);
}

@@ -44,0 +54,0 @@

{ "name": "express-resource"
, "description": "Resourceful routing for express"
, "version": "0.2.2"
, "version": "0.2.3"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "contributors": [

@@ -87,3 +87,9 @@ # Express Resource

};
// or
User.load = function(req, id, fn) {
fn(null, users[id]);
};
app.resource('users', { show: ..., load: User.load });

@@ -90,0 +96,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc