【发布时间】:2021-10-05 19:23:41
【问题描述】:
app.use((err, req, res, next) => {
if (err.type === 'entity.too.large')
res.send(
'<p align="center">Please upload an image below the defined limit of 5 MB. <br> Click <a href="/create">here</a> to visit the upload page again.</p>'
)
else res.redirect('/')
})
我有这段代码来捕捉错误。但是 AWS 仍然显示这个而不是预期的文本。
应用托管在 Elastic Beanstalk 的 EC2 实例中。
【问题讨论】:
标签: node.js express amazon-elastic-beanstalk