Backend Routes - AnisurK24/Turo_Clone GitHub Wiki


HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users/:id - Retrieve the user's information
  • POST /api/users - User sign up

session

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

cars

  • GET /api/cars - Return a list of cars for rent
  • GET /api/cars/:id - User can view the car show page
  • POST /api/cars - Car owner can add a car for rent
  • PATCH /api/cars/:id - Car owner can edit the car they have for rent
  • DELETE /api/cars/:id - Car owner can delete their car rental

rentals

  • GET /api/rentals - Return rentals for the current user
  • POST /api/rentals - User can rent a car
  • DELETE /api/rentals/:id - User can cancel their car rental

reviews

  • GET /api/reviews - Return reviews for a car
  • POST /api/reviews - Create a new review for a car
  • PATCH /api/reviews/:id - User can edit their review
  • DELETE /api/reviews/:id - User can delete their review