chat-app/backend/config/initializers/cors.rb

10 lines
292 B
Ruby
Raw Normal View History

2025-02-15 22:16:39 +09:00
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins 'localhost:3001' # Vue.jsを動作させているアドレスとポート番号
resource '*',
headers: :any,
methods: %i[get post put patch delete options head]
end
end