Skip to content

Backend Route

Ryan Mullen edited this page Sep 2, 2022 · 6 revisions

Backend Route

HTML

  • GET / - StaticPagesController#root

API Endpoints

users

  • GET /api/users/:id - current user's show page - contains booking show, update, and delete
  • POST /api/users - signup page
  • PATCH /api/users/:id - edit form
  • DELETE /api/users/:id - delete user

session

  • GET /api/session - see current user
  • POST /api/session - login page
  • DELETE /api/session - logout

campgrounds

  • GET /api/campgrounds - campground index
  • GET /api/campground/:id - campground show page - contains review index

bookings

  • GET /api/bookings - booking index
  • POST /api/bookings - book a campground
  • PATCH /api/bookings/:id - edit a booking
  • DELETE /api/bookings/:id - delete a booking

review

  • POST /api/review - create review for a campground (campground_id passed through params)
  • PATCH /api/review/:id - edit form
  • DELETE /api/review/:id - delete review
Clone this wiki locally