Backend Challenge

  1. Modify the GET /status route to only return a 200 OK if the server is currently connected to the database

Modified:
app/api/status/controller

  1. Add a test for PUT /user/:id that shows the current user must match the user id in the url in order for the update to be successful

Modified:
app/api/user/controller
test/api/user/read-by-id

  1. Create a new module called notes that lets a user a save notes to their account. A Note should simply have a title and a message in addition to the common properties such as id, createdAt and modifiedAt.

Added:
modules/notes/index
modules/notes/model
modules/notes/service
Modified:
modules/user/model

  1. Add the route GET /user/:id/notes which should list all notes for that user. Remember to ensure the user id in the url matches the current user making the request

Added:
app/api/notes/auth
app/api/notes/controller
app/api/notes/index
app/api/notes/router
app/api/notes/validator
Modified:
app/api/index

  1. Add a test for the previous route to show that it works correctly

Modified:
test/lib/mock-data
test/api/user/read-by-id

  1. Add a route POST /note which should let a logged in user create a note and save it to their account

Modified:
app/api/common/auth
test/api/user/read-by-id