thingspeak/config/routes.rb

43 lines
1.5 KiB
Ruby
Raw Normal View History

2011-03-27 22:56:15 +02:00
Thingspeak::Application.routes.draw do
# main data posts using this route
match 'update', :to => 'channels#post_data', :as => 'update', :via => ((GET_SUPPORT) ? ['get', 'post'] : 'post')
# handle subdomain routes
match '/', :to => 'subdomains#index', :constraints => { :subdomain => 'api' }
match 'crossdomain', :to => 'subdomains#crossdomain', :constraints => { :subdomain => 'api' }
2011-03-30 22:54:46 +02:00
match 'crossdomain', :to => 'subdomains#crossdomain'
2011-03-27 22:56:15 +02:00
root :to => 'pages#home'
resource :user_session
resource 'account', :to => 'users'
resources :users
# specific feeds
2011-04-06 00:25:41 +02:00
match 'channels/:channel_id/feed(s)(.:format)' => 'feed#index'
match 'channels/:channel_id/field(s)/:field_id(.:format)' => 'feed#index'
match 'channels/:channel_id/field(s)/:field_id/:id(.:format)' => 'feed#show'
match 'channels/:channel_id/feed(s)/entry/:id(.:format)' => 'feed#show'
2011-03-27 22:56:15 +02:00
2011-04-05 22:26:52 +02:00
# import
match 'channels/:channel_id/import' => 'channels#import', :as => 'channel_import'
match 'channels/:channel_id/upload' => 'channels#upload'
2011-03-27 22:56:15 +02:00
# nest feeds into channels
resources :channels do
resources :feed
resources :feeds, :to => 'feed'
2011-03-27 22:56:15 +02:00
resources :api_keys
resources :status
resources :statuses, :to => 'statuses'
2011-03-27 22:56:15 +02:00
resources :charts
end
match 'login' => 'user_sessions#new', :as => :login
match 'logout' => 'user_sessions#destroy', :as => :logout
match 'users/reset_password', :to => 'users#reset_password', :as => 'reset_password'
match 'forgot_password', :to => 'users#forgot_password', :as => 'forgot_password'
match ':controller(/:action(/:id(.:format)))'
end