Skip to content

Backend

AAfghahi edited this page Oct 4, 2020 · 2 revisions

HTML


  • GET/StaticPagesController#root

API Endpoints


users

  • GET /api/users - Finds the user, and returns their routes, their preferred trails, their comments, and their lists.
  • POSTS /api/users - Lets a new user sign up

session

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

lists

  • GET /api/lists - returns lists that a user has created
  • GET /api/list/:id - returns a specific list.
  • POST /api/lists - creates a list
  • PATCH /api/lists/:id - edit a list
  • DELETE /api/lists/:id - delete a list

trails

  • GET /api/trails - finds and returns a trail
  • GET /api/trails/:id -finds a specific trail

users_trails

  • GET /api/users/trails - finds and returns all trails that a user has saved.
  • GET /api/users/trails/:id - finds and returns a specific trail for a user.
  • POST /api/users/trails - creates a trail in the user's directory (favorites a trail), , user can add a description and a rating of the trail.
  • PATCH /api/user/trails - edits a trail's peripherals (the description and review).
  • DELETE /api/user/trails - deletes a trail from a user's list.

Reviews

  • GET /api/trails/:id/reviews - finds the reviews that a trail has.
  • GET /api/trails/:id/reviews/:id - finds a specific review that a trail has.
  • POST /api/trails/:id/reviews - reviews a trail.
  • PATCH /api/trails/:id/reviews/:id - lets user edit a trail that they left on a trail.
  • DELETE /api/trails/:id/reviews/:id - delete a trail that has been left on a trail.

Followers

  • GET /api/followers - gets all the followers associated with a user.
  • GET /api/followers/:id - finds a specific follower.
  • POST /api/followers - follow another user.
  • DELETE /api/workouts/:id - stop following a user.

Clone this wiki locally