backend routes - mxcrpntr/oughtify GitHub Wiki

HTML

  • GET / StaticPagesController#frontend_index

Rails Routes Preview:

namespace :api do
   resources :users, only: [:create,:show,:update]
   resource :session, only: [:create,:show,:destroy]
   resources :artists, only: [:show]
   resources :albums, only: [:index,:show] do
     resources :songs, only: [:index]
   end
   resources :playlists, only: [:create,:show,:update,:destroy]
   resources :likes, only: [:create,:destroy]
   resources :follows, only: [:create,:destroy]
end

Backend Routes

users

  • GET /api/users - returns all users (to be filtered)
  • GET /api/users/:id - returns one user's information
  • POST /api/users - sign up
  • PUT/PATCH /api/users/:id - updates user info

session

  • GET /api/session - returns session info
  • POST /api/session - log in
  • DELETE /api/session - log out

artists

  • GET /api/artists/:id - returns artist

albums

  • GET /api/albums/:id - returns album

songs

  • GET /api/albums/:album_id/songs/ - returns songs on album

playlists

  • GET /api/playlists/:id - returns playlist
  • POST /api/playlists/ - creates playlist
  • PUT/PATCH /api/playlists/:id - updates playlist
  • DELETE /api/playlists/:id - removes playlist

likes

  • POST /api/likes/ - creates likes
  • DELETE /api/likes/:id - removes likes

follows

  • POST /api/follows/ - creates follow
  • DELETE /api/follows/:id - removes follow