开放跨域
This commit is contained in:
parent
417484f3ad
commit
ae08031440
1
Gemfile
1
Gemfile
|
@ -17,6 +17,7 @@ gem 'delayed_job_active_record'#, :group => :production
|
||||||
gem 'daemons'
|
gem 'daemons'
|
||||||
gem 'grape', '~> 0.9.0'
|
gem 'grape', '~> 0.9.0'
|
||||||
gem 'grape-entity'
|
gem 'grape-entity'
|
||||||
|
gem 'rack-cors', :require => 'rack/cors'
|
||||||
gem 'seems_rateable', '~> 1.0.13'
|
gem 'seems_rateable', '~> 1.0.13'
|
||||||
gem 'rails', '~> 3.2'
|
gem 'rails', '~> 3.2'
|
||||||
gem "jquery-rails", "~> 2.0.2"
|
gem "jquery-rails", "~> 2.0.2"
|
||||||
|
|
|
@ -71,6 +71,14 @@ module RedmineApp
|
||||||
|
|
||||||
config.action_view.sanitized_allowed_tags = 'div', 'p', 'span', 'img', 'embed'
|
config.action_view.sanitized_allowed_tags = 'div', 'p', 'span', 'img', 'embed'
|
||||||
|
|
||||||
|
config.middleware.use Rack::Cors do
|
||||||
|
allow do
|
||||||
|
origins '*'
|
||||||
|
# location of your API
|
||||||
|
resource '/api/*', :headers => :any, :methods => [:get, :post, :options, :put]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
config.before_initialize do
|
config.before_initialize do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue