Skip to content

Backend Routes

le-s edited this page Dec 12, 2018 · 3 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

USERS

  • POST /api/users - Create new users
  • GET /api/users/:id - Gets user's rental information

SESSION

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

CARS

  • GET /api/cars - Get list of all cars
  • GET /api/cars/:id - Displays car show page
  • GET /api/cars/:id/rentals - Displays all rentals for a given car
  • POST /api/cars - Create a car listing
  • PATCH /api/cars/:id - Edit a car listing
  • DELETE /api/cars/:id - Remove car listing

RENTALS

  • GET /api/rentals - Gets all rentals relevant to user
  • POST /api/rentals - Rent a car
  • DELETE /api/rentals/:id - Cancel rental

REVIEWS

  • GET /api/reviews - Returns relevent reviews (filtered by car)
  • POST /api/reviews - Create review for car
  • PATCH /api/reviews/:id - Edit review
  • DELETE /api/reviews/:id - Delete review
Clone this wiki locally