How to set up the express framework of node.js so that the jump fails when clicking the button, and then jumps directly to the 404 interface instead of reporting an error directly. How to solve this?
滿天的星座2017-06-08 11:04:48
I think so. When clicking, the http status code of the header is returned after judging the request. If the jump is 200 successfully, if it is 4XX, 5XX, it will be displayed through an error page template. I don’t know if it is correct.
ringa_lee2017-06-08 11:04:48
Depends on what error is reported. If it is 500, there must be a problem with your server code that needs to be dealt with. If it is 4xx, you can handle it accordingly according to the statusCode