Skip to content

Backend Routes

AlexDoes edited this page Dec 17, 2021 · 4 revisions

Backend Routes

HTML

  • GET /StaticPagesController#root

API Endpoints

users

  • GET /api/users/ to return all users.
  • GET /api/users/:id to search and display the specific user with their listings, reservations, and reviews they've interacted with.
  • POST /api/users to sign up as a new user.
  • PATCH /api/users/:id to update the specific user account associated with the user ID.

sessions

  • POST /api/session to sign in a user.
  • DELETE /api/session to sign out a user.

listings

  • GET /api/listings to return all listings.
  • GET /api/listings/:id to return the listing associated with the ID.
  • GET /api/users/:user/listings to return all listings associated with a specific user associated with the user ID.
  • POST /api/listings to create a new listing.
  • PATCH /api/listings/:id to update a specific listing associated with the ID.
  • DELETE /api/listings/:id to delete the specific listing associated with the ID.

reservations

  • GET /api/user/:user/reservations to return all reservations for a specific user associated with the user ID.
  • GET /api/reservations/:id to return the specific reservation associated with the ID.
  • POST /api/reservations to make a new reservation.
  • PATCH /api/reservations/:id to update the specific reservation associated with the ID.
  • DELETE /api/reservations/:id to delete the specific reservation associated with the ID.

reviews

  • GET /api/listing/:listing/reviews/ to return all reviews for a specific listing associated with the listing ID.
  • GET /api/reviews/:id to return the review associated with the ID.
  • POST /api/reviews to create a new review.
  • PATCH /api/reviews/:id to update a specific review associated with the ID.
  • DELETE /api/reviews/:id to delete the specific review associated with the ID.

Clone this wiki locally