Backend Routes - nramabad/Clone-ify GitHub Wiki

Backend Routes

HTML

GET/ StaticPagesController#root

API Endpoints

albums

GET /api/albums - returns all albums

GET /api/albums/:album_id - returns specific albums information (title, all songs through association)

artists

GET /api/artists - returns all artists

GET /api/artists/:artist_id - returns specific artists information (name, albums through association)

follows

POST /api/follows - add a follow (user_id, followable_id, followable_type)

DELETE /api/follows - remove a follow (user_id, followable_id, followable_type)

playlist_songs

POST /api/playlist_songs - add song to playlist (input song & playlist) DELETE /api/playlist_songs/:song_id - delete song from playlist

playlists

GET /api/playlists - returns all playlists GET /api/playlists/:playlist_id - returns a specific playlist's relevant information POST /api/playlists - creates a new playlist PATCH /api/playlists/:playlist_id - updates an existing playlist DELETE /api/playlists/:playlist_id - deletes an existing playlist

search

GET /api/search - searches songs, playlists and albums

session

POST /api/session - logs in a user

DELETE /api/session - logs out a user

songs

GET /api/songs - returns all songs in database

user_follows

POST /api/user_follows - follow a user (followee_id, follower_id)

DELETE /api/user_follows/:follow_id - unfollow a user (followee_id, follower_id)

users

GET /api/users/:id - returns user information (profile & saved/followed items, followers & followed)

POST /api/users - creates user profile