100 lines
4.2 KiB
Ruby
100 lines
4.2 KiB
Ruby
SampleApp::Application.routes.draw do
|
|
|
|
scope :as => 'jam_ruby' do
|
|
resources :users
|
|
resources :music_sessions
|
|
end
|
|
|
|
resources :users
|
|
resources :music_sessions
|
|
resources :friend_requests
|
|
|
|
resources :sessions, only: [:new, :create, :destroy]
|
|
|
|
root to: 'static_pages#home'
|
|
|
|
match '/signup', to: 'users#new'
|
|
match '/email_sent', to: 'users#email_sent'
|
|
match '/signin', to: 'sessions#new'
|
|
match '/signout', to: 'sessions#destroy', via: :delete
|
|
|
|
match '/help', to: 'static_pages#help'
|
|
match '/about', to: 'static_pages#about'
|
|
match '/contact', to: 'static_pages#contact'
|
|
|
|
match '/client', to: 'clients#index'
|
|
|
|
match '/confirm/:signup_token', to: 'users#signup_confirm'
|
|
|
|
scope '/api' do
|
|
# music sessions
|
|
match '/sessions/:id/participants' => 'api_music_sessions#participant_create', :via => :post
|
|
match '/participants/:id' => 'api_music_sessions#participant_show', :via => :get, :as => 'api_session_participant_detail'
|
|
match '/participants/:id' => 'api_music_sessions#participant_delete', :via => :delete
|
|
match '/sessions/:id' => 'api_music_sessions#show', :via => :get, :as => 'api_session_detail'
|
|
match '/sessions/:id' => 'api_music_sessions#delete', :via => :delete
|
|
match '/sessions' => 'api_music_sessions#index', :via => :get
|
|
match '/sessions' => 'api_music_sessions#create', :via => :post
|
|
|
|
# genres
|
|
match '/genres' => 'api_genres#index', :via => :get
|
|
|
|
# users
|
|
match '/users' => 'api_users#index', :via => :get
|
|
match '/users/:id' => 'api_users#show', :via => :get, :as => 'api_user_detail'
|
|
#match '/users' => 'api_users#create', :via => :post
|
|
match '/users/:id' => 'api_users#update', :via => :post
|
|
match '/users/:id' => 'api_users#destroy', :via => :delete
|
|
match '/users/confirm/:signup_token' => 'api_users#signup_confirm', :via => :post, :as => 'api_signup_confirmation'
|
|
|
|
# login/logout
|
|
match '/auth_sessions' => 'api_users#auth_session_create', :via => :post
|
|
match '/auth_sessions' => 'api_users#auth_session_delete', :via => :delete
|
|
|
|
# friend requests
|
|
match '/users/:id/friend_requests' => 'api_users#friend_request_index', :via => :get
|
|
match '/friend_requests/:id' => 'api_users#friend_request_show', :via => :get, :as => 'api_friend_request_detail'
|
|
match '/friend_requests' => 'api_users#friend_request_create', :via => :post
|
|
match '/friend_requests/:id' => 'api_users#friend_request_update', :via => :put
|
|
|
|
# friends
|
|
match '/users/:id/friends' => 'api_users#friend_index', :via => :get
|
|
match '/users/:id/friends/:friend_id' => 'api_users#friend_destroy', :via => :delete
|
|
|
|
# user followers
|
|
match '/users/:id/followers' => 'api_users#follower_index', :via => :get
|
|
|
|
# user followings
|
|
match '/users/:id/followings' => 'api_users#following_index', :via => :get, :as => 'api_following_index'
|
|
match '/users/:id/followings' => 'api_users#following_create', :via => :post
|
|
match '/users/:id/followings/:user_id' => 'api_users#following_destroy', :via => :delete
|
|
|
|
# favorites
|
|
match '/users/:id/favorites' => 'api_users#favorite_index', :via => :get
|
|
match '/users/:id/favorites' => 'api_users#favorite_create', :via => :post
|
|
match '/users/:id/favorites/:recording_id' => 'api_users#favorite_destroy', :via => :delete
|
|
|
|
# bands
|
|
match '/bands' => 'api_bands#index', :via => :get
|
|
match '/bands/:id' => 'api_bands#show', :via => :get, :as => 'api_band_detail'
|
|
match '/bands' => 'api_bands#create', :via => :post
|
|
match '/bands/:id' => 'api_bands#update', :via => :post
|
|
|
|
# band followers
|
|
match '/bands/:id/followers' => 'api_bands#follower_index', :via => :get
|
|
|
|
# invitations
|
|
match '/invitations/:id' => 'api_invitations#show', :via => :get, :as => 'api_invitation_detail'
|
|
match '/invitations/:id' => 'api_invitations#delete', :via => :delete
|
|
match '/invitations' => 'api_invitations#index', :via => :get
|
|
match '/invitations' => 'api_invitations#create', :via => :post
|
|
|
|
# invitations
|
|
match '/instruments/:id' => 'api_instruments#show', :via => :get, :as => 'api_instrument_detail'
|
|
match '/instruments' => 'api_instruments#index', :via => :get
|
|
|
|
# search
|
|
match '/search' => 'api_search#index', :via => :get
|
|
end
|
|
end
|