scube-server/config/routes.rb
Thibault Jouan 6379da88e2 Implement Cross-Origin Resource Sharing:
* Add Api::ApplicationController
* Route OPTION requests (CORS preflight) to API application controller
* Filter all API requests through #cor_filter in API application
  controller
2012-03-11 22:19:42 +00:00

24 lines
457 B
Ruby

Scube::Application.routes.draw do
namespace :api do
namespace :v0 do
resources :playlists, :only => [:index]
end
match '*all' => 'application#cor_preflight', :via => :options
end
resources :sounds, :only => [:show]
resources :users, :only => [:new, :create]
resources :sessions, :only => [:new, :create]
resources :tracks do
get 'download', :on => :member
end
resources :playlists
root :to => 'home#index'
end