Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrianwilker/personal-library
Add or remove books from the list or comment about them.
https://github.com/adrianwilker/personal-library
chai freecodecamp javascript mocha qa quality-assurance
Last synced: 9 days ago
JSON representation
Add or remove books from the list or comment about them.
- Host: GitHub
- URL: https://github.com/adrianwilker/personal-library
- Owner: adrianwilker
- Created: 2024-01-24T17:29:07.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-24T17:49:43.000Z (10 months ago)
- Last Synced: 2024-10-11T22:41:19.590Z (about 1 month ago)
- Topics: chai, freecodecamp, javascript, mocha, qa, quality-assurance
- Language: JavaScript
- Homepage: https://personal-library-xese.onrender.com/
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Personal Library
This project was developed in the freeCodeCamp's Quality Assurance course.
To complete this project I had to implement the API with the
GET
,POST
andDELETE
methods. To do this, establish a connection with MongoDB, a NoSQL database. After that, I implemented and performed the necessary unit tests.It's also available on replit: replit.com/@adrianwilker/personal-library.
Deploy: personal-library-xese.onrender.com
In this project were used:
- Bootstrap
- Chai
- Express
- JavaScript
- Mocha
- MongoDB
- Mongoose
- Node.js
Tests:
- You can send a POST request to
/api/books
withtitle
as part of the form data to add a book. The returned response will be an object with thetitle
and a unique_id
as keys. Iftitle
is not included in the request, the returned response should be the stringmissing required field title
. - You can send a GET request to
/api/books
and receive a JSON response representing all the books. The JSON response will be an array of objects with each object (book) containingtitle
,_id
, andcommentcount
properties. - You can send a GET request to
/api/books/{_id}
to retrieve a single object of a book containing the propertiestitle
,_id
, and acomments
array (empty array if no comments present). If no book is found, return the stringno book exists
. - You can send a POST request containing
comment
as the form body data to/api/books/{_id}
to add a comment to a book. The returned response will be the books object similar to GET/api/books/{_id}
request in an earlier test. Ifcomment
is not included in the request, return the stringmissing required field comment
. If no book is found, return the stringno book exists
. - You can send a DELETE request to
/api/books/{_id}
to delete a book from the collection. The returned response will be the stringdelete successful
if successful. If no book is found, return the stringno book exists
. - You can send a DELETE request to
/api/books
to delete all books in the database. The returned response will be the stringcomplete delete successful
if successful.