0

I have a problem with Heroku and my ReactJS application on the front-end side. I have RESTfull API with Ruby on Rails uploaded on the Heroku server ( to do some testings before I purchase actual hosting), and suddenly from today, i cannot use my API on the Heroku, due Privacy and SSL errors ( I didn't change or update anything on Heroku and the API). I got those errors on the browser : enter image description here

I cannot find any solution online. Any suggestion?

pureofpure
  • 1,060
  • 2
  • 12
  • 31

1 Answers1

0

You can use rack cors to enable CORS. Add this code to your config/application.rb

use Rack::Cors do
  allow do
    origins '*'
    resource '*', headers: :any, methods: :any
  end  
end
Snake
  • 1,157
  • 1
  • 10
  • 21