This is the starter repository for the Further APIs session. It provides a start to creating a Minimalist Book Manager API.
- NodeJS installed (v18.12.1 Long Term Support version at time of writing)
- Fork this repo to your Github and then clone the forked version of this repo
In order to run the unit tests run, firstly install the dependencies (if you haven't already done so)
npm install
Followed by:
npm start
In order to run the unit tests run, firstly install the dependencies (if you haven't already done so)
npm install
Followed by:
npm test
Retrieve all books available in the collection.
URL: /api/v1/books Method: GET Response: Returns a list of all books in the database.
Retrieve a specific book by its unique identifier.
URL: /api/v1/books/:id Method: GET Parameters: id (required): The unique identifier of the book. Response: Returns the details of the book corresponding to the provided ID.
Update information for a specific book using its unique identifier.
URL: /api/v1/books/:id Method: PUT Parameters: id (required): The unique identifier of the book. Request Body: Includes the updated information for the book. Response: Returns the updated details of the book.
Add a new book to the collection.
URL: /api/v1/books Method: POST Request Body: Contains the details of the new book to be added. Response: Returns the details of the newly added book.
Delete a specific book from the collection by its unique identifier.
URL: /api/v1/books/:id Method: DELETE Parameters: id (required): The unique identifier of the book to be deleted. Response: Returns a success message upon successful deletion of the book.