From: Simon Brandhof Date: Thu, 3 Apr 2014 10:40:39 +0000 (+0200) Subject: SONAR-5197 Redirect URL /api to /api/webservices/list X-Git-Tag: 4.3~160 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c3f811fa01b5148aa1c67a2c7940bda737283c32;p=sonarqube.git SONAR-5197 Redirect URL /api to /api/webservices/list --- 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 }