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 featurePOST /api/users- sign up
session
POST /api/session- log inDELETE /api/session- log out
runs
GET /api/runs- returns relevant runs (filtered bydata/params)GET /api/runs/:id- returns runPOST /api/runs- creates a runPATCH /api/runs/:id- edit a runDELETE /api/runs/:id- remove a run
goals
GET /api/:user_id/goals- returns all goals for userGET /api/:user_id/goals/:id- returns runPOST /api/:user_id/goals- creates a runPATCH /api/:user_id/goals/:id- edit a runDELETE /api/:user_id/goals/:id- remove a run
comments
GET /api/comments- returns relevant chirps (filtered bydata/params)GET /api/comments/:id- returns commentPOST /api/comments- creates a commentPATCH /api/comments/:id- edit a commentDELETE /api/comments/:id- remove a comment
cheers
POST /api/chirps/:run_id/cheers- cheers a runDELETE /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.