【发布时间】:2016-09-20 13:05:56
【问题描述】:
这听起来可能很愚蠢,但是否可以使用 NodeJS 呈现默认浏览器错误页面?
我在互联网上找到的所有内容都是制作个性化内容(简单的文本
【问题讨论】:
标签: node.js error-handling http-status-code-404 render default
这听起来可能很愚蠢,但是否可以使用 NodeJS 呈现默认浏览器错误页面?
我在互联网上找到的所有内容都是制作个性化内容(简单的文本
【问题讨论】:
标签: node.js error-handling http-status-code-404 render default
我想也许你可以发送一个纯文本,例如:
app.get('/', function(req, res) {
res.type('text/plain'); // set content-type
res.send('Error 404'); // send text response
});
【讨论】: