jam-cloud/config/routes.rb

185 lines
9.1 KiB
Ruby
Raw Normal View History

SampleApp::Application.routes.draw do
2012-09-03 22:03:16 +00:00
scope :as => 'jam_ruby' do
resources :users
2012-10-03 00:54:29 +00:00
resources :music_sessions
2012-09-03 22:03:16 +00:00
end
2012-09-03 22:03:16 +00:00
resources :users
2012-10-03 00:54:29 +00:00
resources :music_sessions
2012-10-15 12:46:51 +00:00
resources :friend_requests
2012-11-22 08:27:00 +00:00
resources :sessions, only: [:new, :create, :destroy]
2012-09-03 22:03:16 +00:00
#root to: 'static_pages#home'
root to: 'clients#index'
# This page is still here, and is under test. Keep a route to it.
match '/oldhome', to: 'static_pages#home'
match '/signup', to: 'users#new'
2012-11-12 12:59:43 +00:00
match '/email_sent', to: 'users#email_sent'
match '/signin', to: 'sessions#new'
match '/signout', to: 'sessions#destroy', via: :delete
2012-11-12 20:12:32 +00:00
# oauth
match '/auth/:provider/callback', :to => 'sessions#create_oauth'
match '/auth/failure', :to => 'sessions#failure'
2012-09-03 22:03:16 +00:00
match '/help', to: 'static_pages#help'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
match '/client', to: 'clients#index'
2012-11-12 12:59:43 +00:00
match '/confirm/:signup_token', to: 'users#signup_confirm'
2012-12-28 07:31:12 +00:00
# password reset
match '/request_reset_password' => 'users#request_reset_password', :via => :get
match '/reset_password' => 'users#reset_password', :via => :post
match '/reset_password_token' => 'users#reset_password_token', :via => :get
match '/reset_password_complete' => 'users#reset_password_complete', :via => :post
2012-10-03 00:54:29 +00:00
scope '/api' do
2012-10-14 02:22:13 +00:00
# music sessions
2012-10-04 02:09:01 +00:00
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'
2012-12-11 22:59:09 +00:00
match '/sessions/:id' => 'api_music_sessions#update', :via => :put
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
2012-12-15 07:10:42 +00:00
# music session tracks
match '/sessions/:id/tracks' => 'api_music_sessions#track_create', :via => :post
match '/sessions/:id/tracks' => 'api_music_sessions#track_index', :via => :get
match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_update', :via => :post
match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_show', :via => :get, :as => 'api_session_track_detail'
match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_destroy', :via => :delete
2012-10-25 15:08:55 +00:00
# genres
match '/genres' => 'api_genres#index', :via => :get
2012-10-14 02:22:13 +00:00
# users
match '/users' => 'api_users#index', :via => :get
match '/users/:id' => 'api_users#show', :via => :get, :as => 'api_user_detail'
2012-11-14 05:37:50 +00:00
#match '/users' => 'api_users#create', :via => :post
match '/users/:id' => 'api_users#update', :via => :post
match '/users/:id' => 'api_users#delete', :via => :delete
2012-11-12 12:59:43 +00:00
match '/users/confirm/:signup_token' => 'api_users#signup_confirm', :via => :post, :as => 'api_signup_confirmation'
match '/users/:id/set_password' => 'api_users#set_password', :via => :put
2012-10-14 02:22:13 +00:00
2012-11-14 05:37:50 +00:00
# login/logout
match '/auth_session' => 'api_users#auth_session_create', :via => :post
match '/auth_session' => 'api_users#auth_session_delete', :via => :delete
2012-11-14 05:37:50 +00:00
# session settings
match '/users/:id/session_settings' => 'api_users#session_settings_show', :via => :get
2012-10-27 22:26:45 +00:00
2013-01-06 20:47:56 +00:00
# session history
match '/users/:id/session_history' => 'api_users#session_history_index', :via => :get
match '/users/:id/session_history/:session_id/users' => 'api_users#session_user_history_index', :via => :get
# user bands
match '/users/:id/bands' => 'api_users#band_index', :via => :get
2012-12-16 23:24:35 +00:00
# user likers
match '/users/:id/likers' => 'api_users#liker_index', :via => :get
# user likes
match '/users/:id/likes' => 'api_users#like_index', :via => :get, :as => 'api_user_like_index'
match '/users/:id/band_likes' => 'api_users#band_like_index', :via => :get, :as => 'api_band_like_index'
match '/users/:id/likes' => 'api_users#like_create', :via => :post
match '/users/:id/likes' => 'api_users#like_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_user_following_index'
match '/users/:id/band_followings' => 'api_users#band_following_index', :via => :get, :as => 'api_band_following_index'
match '/users/:id/followings' => 'api_users#following_create', :via => :post
2012-12-04 03:40:40 +00:00
match '/users/:id/followings' => 'api_users#following_destroy', :via => :delete
# favorites
match '/users/:id/favorites' => 'api_users#favorite_index', :via => :get, :as => 'api_favorite_index'
match '/users/:id/favorites' => 'api_users#favorite_create', :via => :post
match '/users/:id/favorites/:recording_id' => 'api_users#favorite_destroy', :via => :delete
# friend requests
match '/users/:id/friend_requests' => 'api_users#friend_request_index', :via => :get
match '/users/:id/friend_requests/:friend_request_id' => 'api_users#friend_request_show', :via => :get, :as => 'api_friend_request_detail'
match '/users/:id/friend_requests' => 'api_users#friend_request_create', :via => :post
match '/users/:id/friend_requests/:friend_request_id' => 'api_users#friend_request_update', :via => :post
# friends
match '/users/:id/friends' => 'api_users#friend_index', :via => :get
match '/users/:id/friends/:friend_id' => 'api_users#friend_destroy', :via => :delete
2012-11-16 02:10:35 +00:00
2012-11-26 13:37:11 +00:00
# user band invitations
2012-11-24 18:23:13 +00:00
match '/users/:id/band_invitations' => 'api_users#band_invitation_index', :via => :get
match '/users/:id/band_invitations/:invitation_id' => 'api_users#band_invitation_show', :via => :get, :as => 'api_user_band_invitation_detail'
2012-11-26 13:37:11 +00:00
match '/users/:id/band_invitations/:invitation_id' => 'api_users#band_invitation_update', :via => :post
2012-11-16 02:10:35 +00:00
# user recordings
match '/users/:id/recordings' => 'api_users#recording_index', :via => :get
match '/users/:id/recordings/:recording_id' => 'api_users#recording_show', :via => :get, :as => 'api_recording_detail'
match '/users/:id/recordings' => 'api_users#recording_create', :via => :post
match '/users/:id/recordings/:recording_id' => 'api_users#recording_update', :via => :post
match '/users/:id/recordings/:recording_id' => 'api_users#recording_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
2012-11-24 18:23:13 +00:00
# band members (NOT DONE)
match '/bands/:id/musicians' => 'api_bands#musician_index', :via => :get
match '/bands/:id/musicians' => 'api_bands#musician_create', :via => :post
match '/bands/:id/musicians/:user_id' => 'api_bands#musician_destroy', :via => :delete
# band likers
match '/bands/:id/likers' => 'api_bands#liker_index', :via => :get
# band followers
2012-11-04 22:54:14 +00:00
match '/bands/:id/followers' => 'api_bands#follower_index', :via => :get
2012-11-11 04:25:28 +00:00
2012-11-16 02:10:35 +00:00
# band recordings
match '/bands/:id/recordings' => 'api_bands#recording_index', :via => :get
2012-11-22 08:27:00 +00:00
match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_show', :via => :get, :as => 'api_band_recording_detail'
match '/bands/:id/recordings' => 'api_bands#recording_create', :via => :post
match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_update', :via => :post
match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_destroy', :via => :delete
2012-11-16 02:10:35 +00:00
# band invitations
2012-11-24 18:23:13 +00:00
match '/bands/:id/invitations' => 'api_bands#invitation_index', :via => :get
match '/bands/:id/invitations/:invitation_id' => 'api_bands#invitation_show', :via => :get, :as => 'api_band_invitation_detail'
2012-11-24 18:23:13 +00:00
match '/bands/:id/invitations' => 'api_bands#invitation_create', :via => :post
match '/bands/:id/invitations/:invitation_id' => 'api_bands#invitation_destroy', :via => :delete
2012-11-16 02:10:35 +00:00
2012-10-27 22:26:45 +00:00
# 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
# instruments
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
# join requests
match '/join_requests/:id' => 'api_join_requests#show', :via => :get, :as => 'api_join_request_detail'
match '/join_requests/:id' => 'api_join_requests#delete', :via => :delete
match '/join_requests' => 'api_join_requests#create', :via => :post
match '/join_requests' => 'api_join_requests#index', :via => :get
2012-12-15 20:17:41 +00:00
# Location lookups
match '/regions' => 'api_maxmind_requests#regions', :via => :get
match '/cities' => 'api_maxmind_requests#cities', :via => :get
2012-10-03 00:54:29 +00:00
end
2012-08-31 02:09:02 +00:00
end