diff --git a/config/routes/api.rb b/config/routes/api.rb index cb950c52ec..120563ce75 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -78,7 +78,8 @@ Openfoodnetwork::Application.routes.draw do end end - get '/reports/:report_type(/:report_subtype)', to: 'reports#show' + get '/reports/:report_type(/:report_subtype)', to: 'reports#show', + constraints: lambda { |_| Flipper.enabled?(:api_reports) } end match '*path', to: redirect(path: "/api/v0/%{path}"), via: :all, constraints: { path: /(?!v[0-9]).+/ }