Backend Routes - MichaelSchwar3/logmyjog GitHub Wiki

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information of displayed comments/runs/friends and for the User Search feature
  • POST /api/users - sign up

session

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

runs

  • GET /api/runs - returns relevant runs (filtered by data/params)
  • GET /api/runs/:id - returns run
  • POST /api/runs - creates a run
  • PATCH /api/runs/:id - edit a run
  • DELETE /api/runs/:id - remove a run

goals

  • GET /api/:user_id/goals - returns all goals for user
  • GET /api/:user_id/goals/:id - returns run
  • POST /api/:user_id/goals - creates a run
  • PATCH /api/:user_id/goals/:id - edit a run
  • DELETE /api/:user_id/goals/:id - remove a run

comments

  • GET /api/comments - returns relevant chirps (filtered by data/params)
  • GET /api/comments/:id - returns comment
  • POST /api/comments - creates a comment
  • PATCH /api/comments/:id - edit a comment
  • DELETE /api/comments/:id - remove a comment

cheers

  • POST /api/chirps/:run_id/cheers - cheers a run
  • DELETE /api/runs/:run_id/cheers - uncheer a run

Note: cheers does not include a GET route because we will have these routes render the api/cheers/show.json.jbuilder view.