Skip to content

Commit

Permalink
disable cors
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Feb 5, 2019
1 parent 68d456f commit 380b915
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ gem 'middleman-dotenv', '~> 2.0'
gem 'middleman-data_source', '~> 0.8.1'
gem 'middleman-livereload'
gem 'html-proofer', '~> 3.7', '>= 3.7.2'
gem 'rack-cors', '~> 1.0', '>= 1.0.2', :require => 'rack/cors'
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ GEM
parallel (1.11.2)
public_suffix (2.0.5)
rack (2.0.3)
rack-cors (1.0.2)
rack-livereload (0.3.16)
rack
rack-test (0.6.3)
Expand Down Expand Up @@ -156,9 +157,10 @@ DEPENDENCIES
middleman-livereload
middleman-sprockets (~> 4.1.0)
pandoc-ruby (~> 2.0)
rack-cors (~> 1.0, >= 1.0.2)
tilt (~> 2.0)!
tzinfo-data
wdm (~> 0.1.0)

BUNDLED WITH
1.15.2
1.16.4
10 changes: 10 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ FileUtils.mkdir('log') unless File.exist?('log')

app = ::Middleman::Application.new

require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*',
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end

run ::Middleman::Rack.new(app).to_app

0 comments on commit 380b915

Please sign in to comment.