Skip to content

API Documentation

jmthorn edited this page Apr 4, 2021 · 31 revisions

API-Routes

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user for specific features.

Users

  • A logged in user may create, edit or delete their own account.

    View:

    • GET /users/:id

    Create:

    • POST /users/:id

    Edit:

    • POST /users/:id

    Delete:

    • DELETE /users/:id

Reviews

  • A logged in user may delete one of their own reviews, removing it from the list of visible reviews without causing a refresh/redirect.

    View:

    • GET /books/:id/reviews

    Create:

    • POST /books/:id/reviews

    Edit:

    • PUT /books/:id/reviews/:id

    Delete:

    • DELETE /books/:id/reviews/:id

ReadStatus

  • A logged in user can add a status to indicate whether they are "Read", "Currently Reading" or "Want to Read".

    View:

    • GET /readstatus/:id

    Create:

    • POST /readstatus

    Edit:

    • PUT /readstatus/:id

Books

  • A logged in user can add/remove a book to the BrainFood database.

    View:

    • GET /books/:id

    Create:

    • POST /books

    Edit:

    • PUT /books/:id

    Delete:

    • DELETE /books/:id

Bookshelves

  • A logged in user can add/remove a Book to their Bookshelf on the specific book's page via a custom category or through a Tag.

    View:

    • GET /bookshelves/:id

    Create:

    • POST /bookshelves

    Edit:

    • PUT /bookshelves/:id

    Delete:

    • DELETE /bookshelves/:id

Tags

  • A logged in user may tag a book, adding or removing it from a bookshelf without causing a refresh/redirect.

    View:

    • GET /books/:id/tags

    Create:

    • POST /books/:id/tags

    Delete:

    • DELETE /books/:id/tags/:id

Clone this wiki locally