Skip to content

Commit

Permalink
Merge pull request #73 from true-runes/development
Browse files Browse the repository at this point in the history
v1.0.1
  • Loading branch information
nikukyugamer authored Jun 19, 2022
2 parents 713c6ac + d049af4 commit b46ec17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem 'paper_trail'
gem 'pg'
gem 'puma'
gem 'rails'
gem 'rack-cors'
gem 'twitter'

group :development, :test do
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ GEM
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3.1)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.3)
Expand Down Expand Up @@ -375,6 +377,7 @@ DEPENDENCIES
paper_trail
pg
puma
rack-cors
rails
rspec-rails
rubocop-rails
Expand Down
23 changes: 8 additions & 15 deletions config/initializers/cors.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Be sure to restart your server when you modify this file.
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins "*"

# Avoid CORS issues when API is called from the frontend app.
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.

# Read more: https://github.com/cyu/rack-cors

# Rails.application.config.middleware.insert_before 0, Rack::Cors do
# allow do
# origins "example.com"
#
# resource "*",
# headers: :any,
# methods: [:get, :post, :put, :patch, :delete, :options, :head]
# end
# end
resource "*",
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end

0 comments on commit b46ec17

Please sign in to comment.