Re:Went Off The Rails: Why I'm Rebuilding Archaeopteryx In C...
by MatthewPhillips on Friday February 24, 2012 @02:19PM
(#3630541)
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);
I'd still end up with this, thanks to callbacks.
Seems to me that what's missing is something that lets me write it in a more simple way. What I have here looks like an absolute nightmare of coupling. So if you have some suggestions you could point me to that show a little more detail, I'd be really grateful.