3 ms·
I would create a DocumentRequest object that takes your req and res, then break apart your callbacks to separate functions on the DocumentRequest prototype. Th
by MatthewPhillips 15y ago
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 15y agoThanks for this. Been thinking about this. Could you recommend a book on patterns like these?