express-resource icon indicating copy to clipboard operation
express-resource copied to clipboard

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

Open ghost opened this issue 12 years ago • 2 comments

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.

ghost avatar Nov 30 '12 23:11 ghost

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'

guo-yu avatar Oct 31 '13 07:10 guo-yu

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

mandyscott avatar Jan 14 '14 08:01 mandyscott