Class: Flame::CorsGenerator
- Inherits:
-
Generators::Base
- Object
- Rails::Generators::Base
- Generators::Base
- Flame::CorsGenerator
- Defined in:
- lib/flame/generators/cors_generator.rb
Constant Summary collapse
- CONFIG =
<<~RUBY Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do origins Rails.env.development? ? ["localhost:5100", "127.0.0.1:5100"] : ENV["FRONTEND_URL"] resource "*", headers: %w[Authorization], methods: :any, expose: %w[Authorization], max_age: 600, credentials: true end end RUBY
Instance Method Summary collapse
Methods inherited from Generators::Base
Instance Method Details
#create_cors_file ⇒ Object
19 20 21 |
# File 'lib/flame/generators/cors_generator.rb', line 19 def create_cors_file create_file("config/initializers/cors.rb", CONFIG) end |