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 =
"Rails.application.config.middleware.insert_before 0, Rack::Cors do\n allow do\n origins Rails.env.development? ? [\"localhost:5100\", \"127.0.0.1:5100\"] : ENV[\"FRONTEND_URL\"]\n resource \"*\",\n headers: %w[Authorization],\n methods: :any,\n expose: %w[Authorization],\n max_age: 600,\n credentials: true\n end\nend\n"
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 |