This file lists the changes that need to be made in each stage. It is ordered in reverse chronological order, meaning that the last changes made will always be on top of the file, so that readers will not have to scroll all the way down with each task added.
Most applications made for the web have to do with some sort of data manipulation. In order to be able to manipulate our data we have to do two things first:
- We need to define the endpoints of our app that our users will use to send
different kinds of requests (GET, POST, DELETE, etc).
- We have to define how do we want our data to look like and of course store them somewhere.
Story: Our client is a record shop owner who wants to have a list of products in the main page of their shop. They know that they want to display the title, the artist, the year, the cover image and the price for each record they have available. However, the client still doesn't have a full list of all their products. He would also like to be able to add new records to his collection.
TODO:
-
Please create two endpoints(routes) for the shop owner
api/records
-> aGET
that will return all records of the storeapi/records
-> aPOST
that will add a new record to the record collection
For now you can just return a string from the above endpoints, just to make sure everything works.
-
Using
lowdb
set up a mock database for our records. It can be empty or it can contain already some fake data. Update the routes above so that they work just like they should.api/records
-> should return all the records that are in our lowdb databaseapi/records
-> should add a new record to our lowdb database