'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 1:[1]

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

Solution 2:[2]

This means that Postman cannot find /api/users/register. You should attach the API definition as well as the server definition

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KibbeWater
Solution 2 alebest