有response.format方法,该方法使用基于“
Accept”标头选择某些呈现方法。http://expressjs.com/4x/api.html#res.format
响应可能如下所示:
res.format({ text: function(){ res.send('hey'); }, html: function(){ res.send('hey'); }, json: function(){ res.send({ message: 'hey' }); }});


