API Documentation - Run5/GoodTrails GitHub Wiki

API Routes

/api/trails/23

  • GET
  • POST
  • PUT/PATCH

/api/mytrails/visited

  • GET
    • This route will retrieve the trails a user has marked as "visited" in their collection
  • POST
    • This route will add the trails a user has marked as "visited" to their collection
  • DELETE
    • This route will remove the trails a user has marked as "visited" in their collection

/api/mytrails/interested

  • GET
    • This route will retrieve the trails a user has marked as "interested" in their collection
  • POST
    • This route will add the trails a user has marked as "interested" to their collection
  • DELETE
    • This route will remove the trails a user has marked as "interested" in their collection

/api/trails/23/reviews

  • GET
    • This route will retrieve all reviews on a specific trail
  • POST
    • This route will add a reviews on a specific trail
  • PUT/PATCH
    • This route will edit reviews on a specific trail
  • DELETE
    • This route will remove a review on a specific trail

/api/users/login

  • POST
    • This route will authenticate a user by comparing the provided credentials with those stored in the database and redirect them to the landing page

/api/users/register

  • POST
    • This route will register a new user based on the information provided and redirect them to the landing page