Merge pull request #1 from turniere/ticket/TURNIERE-79
Allow access from all origins
This commit is contained in:
commit
9c65b98a8b
2
Gemfile
2
Gemfile
|
|
@ -32,6 +32,8 @@ gem 'bootsnap', '>= 1.1.0', require: false
|
||||||
gem 'devise'
|
gem 'devise'
|
||||||
gem 'devise_token_auth'
|
gem 'devise_token_auth'
|
||||||
|
|
||||||
|
gem 'rack-cors'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||||
gem 'byebug', platforms: %i[mri mingw x64_mingw]
|
gem 'byebug', platforms: %i[mri mingw x64_mingw]
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ GEM
|
||||||
powerpack (0.1.2)
|
powerpack (0.1.2)
|
||||||
puma (3.12.0)
|
puma (3.12.0)
|
||||||
rack (2.0.5)
|
rack (2.0.5)
|
||||||
|
rack-cors (1.0.2)
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
railroady (1.5.3)
|
railroady (1.5.3)
|
||||||
|
|
@ -192,6 +193,7 @@ DEPENDENCIES
|
||||||
devise_token_auth
|
devise_token_auth
|
||||||
listen (>= 3.0.5, < 3.2)
|
listen (>= 3.0.5, < 3.2)
|
||||||
puma (~> 3.11)
|
puma (~> 3.11)
|
||||||
|
rack-cors
|
||||||
railroady
|
railroady
|
||||||
rails (~> 5.2.1)
|
rails (~> 5.2.1)
|
||||||
rubocop
|
rubocop
|
||||||
|
|
|
||||||
|
|
@ -33,5 +33,12 @@ module TurniereBackend
|
||||||
# Middleware like session, flash, cookies can be added back manually.
|
# Middleware like session, flash, cookies can be added back manually.
|
||||||
# Skip views, helpers and assets when generating a new resource.
|
# Skip views, helpers and assets when generating a new resource.
|
||||||
config.api_only = true
|
config.api_only = true
|
||||||
|
|
||||||
|
config.middleware.insert_before 0, Rack::Cors do
|
||||||
|
allow do
|
||||||
|
origins '*'
|
||||||
|
resource '*', headers: :any, methods: :any
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue