Skip to content

Backend Routes

Madeline Wilson edited this page Nov 1, 2021 · 12 revisions

HTML


  • GET / StaticPagesController#root

API Endpoints


users

  • GET /api/users/:id returns details of a single user - their name, email, and profile picture, as well as any artists they are following and genres they have liked (through the followees and genresLiked associations), or their albums and followers (if they are an artist)
  • POST /api/users signs up a new user, returns current user information
  • PATCH /api/users/:id edit a user (if current user matches :id)
  • GET /api/users/search allows for searching for users and artists (artists are users with an artist key of 'true')

session

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

albums

  • GET /api/albums/:id returns all songs for a particular album, used for artist show page and search index

songs

  • GET /api/songs/:id returns information for a particular song, used for playing song on artist or home page

genres

  • GET /api/genres returns all genres, used for home page and search index
  • GET /api/genres/:id returns information for a particular genre

Clone this wiki locally