Skip to content

Commit

Permalink
add rack-cors for serving cors on annos
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Mar 1, 2018
1 parent a577fc6 commit 9bd8004
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ gem 'mysql2'

gem 'honeybadger'
gem 'annotot'
gem 'rack-cors', :require => 'rack/cors'


group :deployment do
gem 'dlss-capistrano'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ GEM
public_suffix (3.0.2)
puma (3.11.2)
rack (2.0.4)
rack-cors (1.0.2)
rack-test (0.8.3)
rack (>= 1.0, < 3)
rails (5.1.5)
Expand Down Expand Up @@ -426,6 +427,7 @@ DEPENDENCIES
mods_display (= 0.3.4)
mysql2
puma
rack-cors
rails (~> 5.0, >= 5.0.1)
rails-controller-testing
rake
Expand Down
7 changes: 7 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '/annotation*', headers: :any, methods: %i[get post options delete patch put]
end
end

end
end

0 comments on commit 9bd8004

Please sign in to comment.