Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
MatthewPhillips
on Feb 24, 2012
|
parent
|
context
|
favorite
| on:
Went Off The Rails: Why I'm Rebuilding Archaeopter...
I would create a DocumentRequest object that takes your req and res, then break apart your callbacks to separate functions on the DocumentRequest prototype. Then you would simply consume it with:
app.get('/documents', new DocumentRequest);
bphogan
on Feb 28, 2012
[–]
Thanks for this. Been thinking about this. Could you recommend a book on patterns like these?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: