Files
astuto/config/initializers/cors.rb
Riccardo Graziosi 31999a2af6 Add API (#427)
2024-11-08 16:40:53 +01:00

10 lines
334 B
Ruby

Rails.application.config.middleware.insert_before 0, Rack::Cors do
# Allow requests from any origin to the API documentation
# Needed for the Swagger UI (Redocusaurus in astuto-docs) to work
allow do
origins '*'
resource '/api-docs/*',
headers: :any,
methods: [:get, :post, :options, :put, :delete]
end
end