add cors
This commit is contained in:
parent
c771455197
commit
3025c88ef7
2
Gemfile
2
Gemfile
|
@ -29,6 +29,8 @@ gem 'jbuilder', '~> 2.7'
|
||||||
gem 'bootsnap', '>= 1.4.2', require: false
|
gem 'bootsnap', '>= 1.4.2', require: false
|
||||||
gem 'rails_12factor', group: :production
|
gem 'rails_12factor', group: :production
|
||||||
|
|
||||||
|
gem 'rack-cors'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||||
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
||||||
|
|
6
config/initializers/cors.rb
Normal file
6
config/initializers/cors.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
||||||
|
allow do
|
||||||
|
origins 'https://bitium.agency'
|
||||||
|
resource '*', headers: :any, methods: :any
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user