Sha256: 7cf2e5f18df58baf774eaedc6aa6a98126750a2a68d70c04013152455d8b4949

Contents?: true

Size: 687 Bytes

Versions: 56

Compression:

Stored size: 687 Bytes

Contents

# 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
    origins ['localhost']

    resource '*',
      headers: :any,
      methods: [:get, :post, :put, :patch, :delete, :options, :head],
      expose: %w[
        X-Requested-With
        Content-Type
        Authorization
        Accept
        Accept-Encoding
        Access-Control-Allow-Credentials
      ],
      credentials: true
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
ibrain-core-0.5.15 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.13 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.12 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.10 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.9 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.8 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.7 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.6 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.5 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.4 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.3 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.2 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.1 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.5.0 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.9 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.8 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.7 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.6 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.5 lib/generators/ibrain/install/templates/config/initializers/cors.tt
ibrain-core-0.4.4 lib/generators/ibrain/install/templates/config/initializers/cors.tt