From c3f811fa01b5148aa1c67a2c7940bda737283c32 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 3 Apr 2014 12:40:39 +0200 Subject: [PATCH] SONAR-5197 Redirect URL /api to /api/webservices/list --- .../webapp/WEB-INF/app/controllers/api/java_ws_controller.rb | 4 ++++ sonar-server/src/main/webapp/WEB-INF/config/routes.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb index a590ddeb7d2..4c592838390 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb @@ -31,4 +31,8 @@ class Api::JavaWsController < Api::ApiController :status => ws_response.stream().httpStatus(), :content_type => ws_response.stream().mediaType() end + + def redirect_to_ws_listing + redirect_to :action => 'index', :wspath => 'api/webservices', :wsaction => 'list' + end end diff --git a/sonar-server/src/main/webapp/WEB-INF/config/routes.rb b/sonar-server/src/main/webapp/WEB-INF/config/routes.rb index 474e68c2dfe..2a04f24fd55 100644 --- a/sonar-server/src/main/webapp/WEB-INF/config/routes.rb +++ b/sonar-server/src/main/webapp/WEB-INF/config/routes.rb @@ -13,6 +13,7 @@ ActionController::Routing::Routes.draw do |map| api.resources :manual_measures, :only => [:index, :create, :destroy], :requirements => { :id => /.*/ } end + map.connect 'api', :controller => 'api/java_ws', :action => 'redirect_to_ws_listing' map.connect 'api/metrics', :controller => 'api/metrics', :action => 'index', :conditions => { :method => :get } map.connect 'api/metrics/:id', :controller => 'api/metrics', :action => 'show', :conditions => { :method => :get } map.connect 'api/metrics/:id', :controller => 'api/metrics', :action => 'create', :conditions => { :method => :post } -- 2.39.5