Last active
June 1, 2016 19:45
-
-
Save chrsgrffth/34ddbff061e134aec7e0b0393bddc0cc to your computer and use it in GitHub Desktop.
Allow Client to Communicate with Rails API (Allow-Access-Control-Origin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CORS config | |
config.middleware.insert_before 0, 'Rack::Cors' do | |
allow do | |
origins 'localhost:3000', 'localhost:3001' | |
resource '*', headers: :any, methods: [:get, :post, :options] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rack Cors. | |
gem 'rack-cors', :require => 'rack/cors' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment