chore: ability to run Chatwoot as API only server (#2344)
- Ability to run chatwoot as an API only server - Removes action cable testing gem since it is merged to rails 6
This commit is contained in:
@@ -76,4 +76,13 @@ Rails.application.configure do
|
||||
Bullet.bullet_logger = true
|
||||
Bullet.rails_logger = true
|
||||
end
|
||||
|
||||
# ref: https://github.com/cyu/rack-cors
|
||||
config.middleware.insert_before 0, Rack::Cors do
|
||||
allow do
|
||||
origins '*'
|
||||
resource '/packs/*', headers: :any, methods: [:get, :options]
|
||||
resource '*', headers: :any, methods: :any, expose: ['access-token', 'client', 'uid', 'expiry']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -110,10 +110,14 @@ Rails.application.configure do
|
||||
|
||||
# font cors issue with CDN
|
||||
# Ref: https://stackoverflow.com/questions/56960709/rails-font-cors-policy
|
||||
# ref: https://github.com/cyu/rack-cors
|
||||
config.middleware.insert_before 0, Rack::Cors do
|
||||
allow do
|
||||
origins '*'
|
||||
resource '/packs/*', headers: :any, methods: [:get, :options]
|
||||
if ActiveModel::Type::Boolean.new.cast(ENV.fetch('CW_API_ONLY_SERVER', false))
|
||||
resource '*', headers: :any, methods: :any, expose: ['access-token', 'client', 'uid', 'expiry']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user