Welcome Maester Nodeon, you have inherited this ledger from your predecessor.
Complete the following tasks to turn this ledger into a wealth of information for all of Westeros.
Ahem, we're going to turn a little technical now.
- Serve all the files in the
publicdirectory on the '/' path of your app. This exposes a frontend that makes requests to the app. - Create a
GET /api/beaststo get all the records. The data can be found indata/beasts.json- Checkout the / route in your browser!
- Add support for query parameter
speciesin the created endpoint. Return an array of records that match the type.- Checkout the
DragonsandDire wolvespages!
- Checkout the
- Checkout the
Register a Beastpage. Create a handler forPOST /api/beasts. Save this information back todata/beasts.json.
Finished? How about some additional challenges? ๐
-
Add support for saving the image file in the
public/data/imagesdirectory. Save the path and other information back todata/beasts.json.- Send file data with the form from the frontend by adding
enctypeto the form.
<form action="/api/beasts" method="post" id="register-form" enctype="multipart/form-data">
- Send file data with the form from the frontend by adding
-
Implement a
PUT /api/beasts/:idendpoint to replace the details of a beast. -
Implement
DELETE /api/beasts/:idendpoint to delete a beast from the ledger.
How did you organise your application?