Skip to content

Backend Routes

taisiat edited this page May 4, 2023 · 4 revisions

HTML

  • GET / - StaticPagesController#FrontendIndex

API Endpoints

Session

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

Users

  • GET /api/users/:id - returns one user's full profile information plus associated data
  • POST /api/users - sign up

Cars

  • GET /api/cars - returns car index page information, with cars filtered by search criteria, plus their associated data
  • GET /api/cars/:id - returns car's show page information containing its full detail and associated data

Trips

  • GET /api/trips/:id - returns trip's show page information containing its full detail and associated info
  • GET /api/trips - all trips' info and associated info
  • POST /api/trips - create a trip
  • DELETE /api/trips/:id - delete a trip
  • PATCH /api/trips/:id - edit a trip

Car Reviews

  • GET /api/reviews - all cars' review data
  • POST /api/reviews - create a review
  • GET /api/reviews/:id - info on a given review
  • DELETE /api/reviews/:id - delete a review
  • PATCH /api/reviews/:id - edit a review

Car Favorites

  • GET /api/favorites - see all favorites for current user
  • POST /api/favorites - favorite a car
  • DELETE /api/favorites/:id - unfavorite a car
Clone this wiki locally