I would like to check if the type that is requested by my client is JSON or HTML, as I want my route to satisfy both human and machine needs.
I have read the Express
It's a bit later, but I found this a better solution for me:
req.accepts('html, json') === 'json'
Hope it helps!