API Routes - stili87/Better-Reads GitHub Wiki
This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user specific features.
Books
-
A logged in user may add a book to the database, delete their books from the database, edit the information on thier books without causing a refresh/redirect. A route will also be able to grab all the books in the database
GET /api/books
- get all books in the databasePOST /api/books
- create new bookPUT /api/books/:id
- edit a user's created bookDELETE /api/books/:id
- delete a user's book
Bookshelves
-
A logged in user may add a bookshelf to the database, delete their bookshelves from the database, edit the information on thier bookshelf (e.g. change the name) without causing a refresh/redirect. A route will also be able to grab all the bookshelves for that user.
GET /api/bookshelves
- get all user specific bookshelves in the databasePOST /api/bookshelves
- create new bookshelfPUT /api/bookshelves/:id
- edit a user's created bookshelfDELETE /api/bookshelves/:id
- delete a user's bookshelf
Reviews
-
A logged in user may add a review to a book, delete their reviews from the database, edit the review without causing a refresh/redirect. A route will also be able to grab all the reviews for a particular book.
GET /api/reviews
- get all reviews for a particular bookPOST /api/reviews
- create new review for a bookPUT /api/reviews
- edit a user's created reviewDELETE /api/reviews
- delete a user's review
Read Status
-
A logged in user may mark their read status of a book, edit the read status of a book without causing a refresh/redirect. A route will also be able to grab current read status for a particular book for a particular user.
GET /api/readstatus
- get the read status for a particular book for a particular user.POST /api/readstatus
- create new read status for a particular book for a particular user.PUT /api/readstatus
- edit read status for a particular book for a particular user.DELETE /api/readstatus
- delete a read status for a particular book for a particular user.