Backend Routes - Orenshaf/SoundProud GitHub Wiki

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information of uploaded and liked tracks and for the User Search feature
  • POST /api/users - sign up

session

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

tracks

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

comments

  • GET /api/comments - gets all comments
  • POST /api/comments - creates a comment
  • DELETE /api/comments/:id - remove a comment

###BONUS!

likes

  • GET /api/likes - gets all likes
  • POST /api/likes - like a track
  • DELETE /api/likes - unlike a track

Note: comments and likes do not include a GET route because we will have these routes render the api/tracks/show.json.jbuilder view. See Sample State.3