Backend Routes - annkim10/pupfinder GitHub Wiki

HTML

  • GET / - StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information with adopter profile info/favorited pups or rescue organization info/list of pups
  • POST /api/users - sign up

session

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

pups

  • GET /api/pups - returns all or relevant pups (filtered by data/ params)
  • GET /api/pups/:id - returns a pup
  • POST /api/pups - creates a pup
  • PATCH /api/pups/:id - edit a pup
  • DELETE /api/pups/:id - remove a pup (yay! they've been adopted!)

favorites

  • POST /api/favorites - favorites a pup
  • DELETE /api/favorites/:id - unfavorite a pup

NOTE: favorites does not include a GET route as it will be rendered under the user's show page as depicted in the Sample State