How to set the express framework of node.js to fail to jump when clicking a button, and then jump directly to the 404 interface instead of reporting an error directly.
给我你的怀抱2017-06-08 11:02:48
0
2
700
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?
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.
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
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.
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