search

Home  >  Q&A  >  body text

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.

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?

给我你的怀抱给我你的怀抱2777 days ago816

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座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.

    reply
    0
  • ringa_lee

    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

    reply
    0
  • Cancelreply