← cd ../blog
how-to-set-cors-origin-in-google-app-engine-for-ruby-project.md skrdev
~February 18, 2021 · 1 min read

How to set CORS origin in Google App Engine for Ruby Project

It took me some time to figure and I can say that there is no way to set CORS origins in google UI. So we will have to install gem inside our API project and…

It took me some time to figure and I can say that there is no way to set CORS origins in google UI. So we will have to install gem inside our API project and deploy changes to google cloud:

  1. Add gem 'rack-cors' to gem file
  2. Bundle install
  3. Add following to application.rb:
config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins '*'
    resource '*', headers: :any, methods: :any
  end
end

Don't forget to update '*'  before deploying to production.
Original post ↗

// keep reading

dmitrii skr.

I build fast, reliable web products — from the data model to the last pixel.

More

© 2026 Dmitrii Skrylev. All rights reserved.

Built with SvelteKit · Lantana, TX · Remote