Files
api/config/initializers/cors.rb
T

18 lines
524 B
Ruby
Raw Normal View History

2026-05-18 13:17:28 -04:00
# Be sure to restart your server when you modify this file.
# 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
2026-07-23 10:41:46 -04:00
origins 'http://localhost:3001'
2026-05-18 13:17:28 -04:00
resource "*",
headers: :any,
2026-07-23 10:41:46 -04:00
methods: [ :get, :post, :put, :patch, :delete, :options, :head ],
credentials: true
2026-05-18 13:17:28 -04:00
end
end