diff --git a/Gemfile b/Gemfile index f67d258..3fefe4f 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,8 @@ gem 'jbuilder', '~> 2.7' gem 'bootsnap', '>= 1.4.2', require: false gem 'rails_12factor', group: :production +gem 'rack-cors' + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb new file mode 100644 index 0000000..6ada343 --- /dev/null +++ b/config/initializers/cors.rb @@ -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 \ No newline at end of file