Created
September 30, 2011 01:37
-
-
Save whalec/1252441 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'api_version' | |
Securus::Application.routes.draw do | |
match "/bb_poc" => "bb_poc#index" | |
scope "(:locale)", :locale => /ar|de|en|fr|it|nl|sr/ do | |
resource :session, :only => [:new, :create, :destroy] | |
resource :profile, :only => [:show, :edit, :update] | |
resources :users, :only => [:new, :create] do | |
post :check_email, :on => :collection | |
post :check_username, :on => :collection | |
end | |
resources :devices do | |
put :set_current, :on => :collection | |
put :set_current, :on => :member | |
resources :folders, :only => [:index, :show, :destroy], :constraints => {:id => /.*/} do | |
get :shared, :on => :collection | |
get :shared_files, :on => :member | |
get :deleted, :on => :collection | |
get :deleted_files, :on => :member | |
end | |
resources :files, :only => [:destroy, :create], :constraints => {:id => /.*/} do | |
get :download | |
get :history | |
post :email | |
post :share | |
end | |
end | |
namespace :api do | |
constraints ApiVersion.new(1) do | |
scope :module => :v1 do | |
match "/version" => "base#version" | |
resources :devices do | |
put :set_current, :on => :collection | |
put :set_current, :on => :member | |
resources :folders, :only => [:index, :show, :destroy], :constraints => {:id => /.*?[^\.json|xml|html]/} do | |
end | |
end | |
end | |
end | |
constraints ApiVersion.new(2) do | |
scope :module => :v2 do | |
match "/version" => "base#version" | |
end | |
end | |
end | |
end | |
# resources :files, :constraints => {:id => /.*/} | |
match '/:locale' => 'devices#index' | |
root :to => "devices#index" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment