Little project focused on Nodejs error handling through Express middlewares.
- handle errors that can crash the node process (in the "let is crash" way)
- define a set of standard lightweight erros that will be returned to the client (web app), hiding the complexity of the real error happened
- log operational and programmers errors with a logger so that it is possible to reconstruct what happened
No attention is made to topics such as validation, code structuring, databases, etc. Only error handling!
- url: http://localhost:3000/users
- method: GET
- url: http://localhost:3000/users/{{user_id}}
- method: GET
- params: user id
- url: http://localhost:3000/users
- method: POST
- body:
- name: user name
- age: user age
- url: http://localhost:3000/users/{{user_id}}
- method: PUT
- params: user id
- body:
- name: user name
- age: user age
- url: http://localhost:3000/users/{{user_id}}
- method: DELETE
- params: user id