2013/11/4 Simon <[email protected]>

>     app.get('/users/:id[int]', function(req, res, id) { ... });
>     app.get('/users/:name', function(req, res, username) { ... });
>


Besides the syntax, IMHO this particular example doesn't sound like a good
API, some of my concerns:

-  It means that the same resource will be found in two different urls
-  Will this api support PUT/PATCH/DELETE to both name and id, etc
-  Few days ago I watched a movie where the protagonist name was 6
http://www.imdb.com/character/ch0250776/?ref_=ttfc_fc_cl_t21 (joke)

For this particular case, I often have /users/:id and /user?name=x, which
read as *query the user resources by name*.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to