2012-08-31 03:01:52 +00:00
|
|
|
SampleApp::Application.routes.draw do
|
2012-08-31 13:18:37 +00:00
|
|
|
|
2012-09-03 22:03:16 +00:00
|
|
|
scope :as => 'jam_ruby' do
|
2012-09-01 20:24:51 +00:00
|
|
|
resources :users
|
2012-10-03 00:54:29 +00:00
|
|
|
resources :music_sessions
|
2012-09-03 22:03:16 +00:00
|
|
|
end
|
2012-08-31 13:18:37 +00:00
|
|
|
|
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
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
resources :sessions, only: [:new, :create, :destroy]
|
2012-09-03 22:03:16 +00:00
|
|
|
|
2012-11-17 21:03:06 +00:00
|
|
|
#root to: 'static_pages#home'
|
|
|
|
|
root to: 'clients#index'
|
2012-08-31 03:01:52 +00:00
|
|
|
|
2012-11-18 17:27:20 +00:00
|
|
|
# This page is still here, and is under test. Keep a route to it.
|
|
|
|
|
match '/oldhome', to: 'static_pages#home'
|
|
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
match '/signup', to: 'users#new'
|
2012-11-12 12:59:43 +00:00
|
|
|
match '/email_sent', to: 'users#email_sent'
|
2012-08-31 03:01:52 +00:00
|
|
|
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
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
match '/help', to: 'static_pages#help'
|
|
|
|
|
match '/about', to: 'static_pages#about'
|
|
|
|
|
match '/contact', to: 'static_pages#contact'
|
|
|
|
|
|
2012-09-21 04:46:45 +00:00
|
|
|
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
|
2012-10-23 12:44:17 +00:00
|
|
|
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
|
2012-10-03 03:57:27 +00:00
|
|
|
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
|
2012-10-03 03:57:27 +00:00
|
|
|
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
|
2012-11-03 13:54:24 +00:00
|
|
|
match '/users/:id' => 'api_users#update', :via => :post
|
2012-12-17 06:02:09 +00:00
|
|
|
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'
|
2012-12-17 06:02:09 +00:00
|
|
|
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
|
2012-11-14 06:08:32 +00:00
|
|
|
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
|
|
|
|
2012-12-17 06:02:09 +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
|
|
|
|
|
|
2012-12-17 06:24:23 +00:00
|
|
|
# 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
|
|
|
|
|
|
2012-11-04 13:34:59 +00:00
|
|
|
# user followers
|
|
|
|
|
match '/users/:id/followers' => 'api_users#follower_index', :via => :get
|
|
|
|
|
|
|
|
|
|
# user followings
|
2012-11-21 19:49:00 +00:00
|
|
|
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'
|
2012-11-04 13:34:59 +00:00
|
|
|
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
|
|
|
|
|
|
2012-12-17 06:02:09 +00:00
|
|
|
# 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
|
2012-11-25 19:38:24 +00:00
|
|
|
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
|
|
|
|
2012-12-17 06:02:09 +00:00
|
|
|
# user recordings
|
2013-02-16 21:19:08 +00:00
|
|
|
# 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
|
2012-11-04 13:34:59 +00:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2012-12-17 06:02:09 +00:00
|
|
|
# band likers
|
|
|
|
|
match '/bands/:id/likers' => 'api_bands#liker_index', :via => :get
|
|
|
|
|
|
2012-11-04 13:34:59 +00:00
|
|
|
# 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'
|
2012-11-21 19:49:00 +00:00
|
|
|
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
|
|
|
|
2012-11-25 19:38:24 +00:00
|
|
|
# band invitations
|
2012-11-24 18:23:13 +00:00
|
|
|
match '/bands/:id/invitations' => 'api_bands#invitation_index', :via => :get
|
2012-11-25 19:38:24 +00:00
|
|
|
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
|
2012-11-25 19:38:24 +00:00
|
|
|
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
|
2012-11-04 03:22:35 +00:00
|
|
|
|
2012-11-21 19:49:00 +00:00
|
|
|
# instruments
|
2012-11-04 03:22:35 +00:00
|
|
|
match '/instruments/:id' => 'api_instruments#show', :via => :get, :as => 'api_instrument_detail'
|
|
|
|
|
match '/instruments' => 'api_instruments#index', :via => :get
|
2012-11-07 13:36:00 +00:00
|
|
|
|
|
|
|
|
# search
|
|
|
|
|
match '/search' => 'api_search#index', :via => :get
|
2012-11-30 15:30:30 +00:00
|
|
|
|
|
|
|
|
# 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
|
2013-01-17 01:53:55 +00:00
|
|
|
|
2013-02-05 02:07:49 +00:00
|
|
|
# Recordings
|
|
|
|
|
match '/recordings' => 'api_recordings_controller#index', :via => :get
|
|
|
|
|
match '/recordings/:id' => 'api_recordings_controller#show', :via => :get
|
|
|
|
|
match '/recordings/:id' => 'api_recordings_controller#update', :via => :put
|
|
|
|
|
match '/recordings/:id' => 'api_recordings_controller#delete', :via => :delete
|
|
|
|
|
match '/recordings/start' => 'api_recordings_controller#start', :via => :post
|
|
|
|
|
match '/recordings/:id/stop' => 'api_recordings_controller#stop', :via => :put
|
2013-01-17 01:53:55 +00:00
|
|
|
match '/recordings/upload_next_part' => 'api_recordings_controller#upload_next_part', :via => :get
|
|
|
|
|
match '/recordings/upload_sign' => 'api_recordings_controller#upload_sign', :via => :get
|
|
|
|
|
match '/recordings/upload_part_complete' => 'api_recordings_controller#upload_part_complete', :via => :put
|
|
|
|
|
match '/recordings/upload_complete' => 'api_recordings_controller#upload_complete', :via => :put
|
2013-02-08 02:25:06 +00:00
|
|
|
|
|
|
|
|
# version check for JamClient
|
|
|
|
|
match '/versioncheck' => 'artifacts#versioncheck'
|
2012-10-03 00:54:29 +00:00
|
|
|
end
|
2012-08-31 02:09:02 +00:00
|
|
|
end
|