Closed seanabrahams closed 13 years ago
Sean, oh my, this took me forever to figure it out! I spent numerous hours trying. This fix makes sense and it works on my plate
Reduction:
//
// URLS:
// Index page: http://localhost:3000/api/
// Service Index page: http://localhost:3000/api/foo/
// Service Resource page: http://localhost:3000/api/foo/something
//
var express = require('express')
, resource = require('../')
, app = express.createServer();
var api = {
index: function(req, res){
res.send('api index');
}
};
var foo = {
index: function(req, res){
res.send('foo index');
},
show: function(req, res) {
res.send('bar all');
}
};
app.resource('api', api);
app.resource('api/foo', foo, { id: 'foo' });
app.listen(3000);
I guess this is as designed, I will write up some docs so others wont come to the same issue
Actually, would be nice if the default was named "id"
Thanks, works great!
Works...
Doesn't work...
In the "Doesn't work..." example the param will be ":admin/user" instead of ":user".