Commit 303523746efc8d0b52d4bb21cdf5d40f30613dc4

Authored by Rodrigo Souto
1 parent e5ecf4b1

api: (finally) fix cors application

Showing 2 changed files with 7 additions and 7 deletions   Show diff stats
config.ru
... ... @@ -6,6 +6,13 @@ require ::File.expand_path('../config/environment', __FILE__)
6 6 #use Rails::Rack::Static
7 7 #run ActionController::Dispatcher.new
8 8  
  9 +use Rack::Cors do
  10 + allow do
  11 + origins '*'
  12 + resource '/api/*', :headers => :any, :methods => [:get, :post]
  13 + end
  14 +end
  15 +
9 16 rails_app = Rack::Builder.new do
10 17 run Noosfero::Application
11 18 end
... ...
config/application.rb
... ... @@ -133,12 +133,5 @@ module Noosfero
133 133  
134 134 Noosfero::Plugin.setup(config)
135 135  
136   - config.middleware.use Rack::Cors do
137   - allow do
138   - origins '*'
139   - resource '/api/*', :headers => :any, :methods => [:get, :post]
140   - end
141   - end
142   -
143 136 end
144 137 end
... ...