backend routes - robmroy/bandvamp GitHub Wiki
-
GET /
StaticPagesController#root
-
GET /api/users/:id
- returns the user information needed for the user's profile page, including followed bands, and purchased albums (both with their photo URL's) -
POST /api/users
- sign up -
PATCH /api/users/:id
- edit user (photo and user description)
-
POST /api/session
- log in -
DELETE /api/session
- log out
-
GET /api/bands/:id
- returns the information needed for the band page, including albums and songs and associated URLs. -
PATCH /api/bands/:id
- edit the band_name and background_color attributes of the user with the given id. -
No
POST
route since band information is stored in the user table, and users are created at/api/users
.
-
GET /api/searches
- returns bands, albums, and songs based on user input
-
GET /api/albums
- grabs all albums (not including music, just the info for display), for use on the frontpage. (A full-fledged website would not exactly have this.) -
POST /api/albums
- posts data for a new album -
PATCH /api/albums/:id
- updates data for an existing album
-
POST /api/songs
- posts data for a new song -
PATCH /api/songs
- updates data for an existing song
-
POST /api/follows
- creates a 'follow'-- a fan_id and band_id indicating that the associated fan follows the associated band DELETE /api/follows
-
POST /api/purchases
- creates a 'purchase'-- a user_id and album_id indicating that the associated user purchased the associated album