visionmedia / express-resource

Resourceful routing for Express
1.41k stars 140 forks source link

load function doesn't add to req object on index route #68

Open ghost opened 11 years ago

ghost commented 11 years ago

When does the load function actually add to the request object? For the show route it adds fine, but for index, the property for the singular named route is not there.

guo-yu commented 10 years ago

did you mean:

var index = require('./index');
app.resource(index).load(function(req,id,next){
     next(null,'demoData');
})

check req.id in index router, in this case above, req.id will be 'demoData'

mandyscott commented 10 years ago

I have the same question, the auto-loader seems to fire for routes except index, is this intentional?