Search code examples
node.jsexpressserverbackend

why nodejs server returned 404 status code in bad request


I can't understand why the server returns the 404 status error code if the wrong route is registered. The server should return 400 status error code. I would like to know what this may be related to.

postman


Solution

  • Status code 404 (not found) is used whenever a resource cannot be found.
    Since your route is not registered and does not exist you will receive 404