Skip to content

Backend routes

ntomsho edited this page Mar 28, 2019 · 6 revisions

Backend Routes

HTML Endpoints

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users/:id - shows a user's profile page: their shelves and recent books
  • POST /api/users/ - sign up

session

  • POST /api/session - log in
  • DELETE /api/session - log out

books

  • GET /api/books - returns relevant books based on search criteria in data/params
  • GET /api/book/:id - shows a book's page: its information, user reviews, and shelves it appears on

shelves

  • GET /api/shelves - returns relevant shelves from book or user show page
  • GET /ai/shelf/:id - shows a shelf's page: listing all books inside it

reviews

  • POST /api/books/:book_id/reviews - post a new review
  • PATCH /api/books/:book_id/reviews - edit a review
  • DELETE /api/books/:book_id/reviews - delete a review

read_statuses

  • GET /api/users/:user_id/books/:book_id - returns read status of a book
  • POST /api/users/:user_id/books/:book_id - adds user's read status for a book
  • UPDATE /api/users/:user_id/books/:book_id - change user's read status for a book
Clone this wiki locally