summaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/config/routes.rb
blob: 474e68c2dfe99ca153feb8d8c7d170eeb41175c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
ActionController::Routing::Routes.draw do |map|
  map.connect 'users/select_group', :controller => 'users', :action => 'select_group'
  map.connect 'users/set_groups', :controller => 'users', :action => 'set_groups'
  map.connect 'users/create_form', :controller => 'users', :action => 'create_form'
  map.connect 'users/edit_form', :controller => 'users', :action => 'edit_form'
  map.resources :users

  map.namespace :api do |api|
    api.resources :events, :only => [:index, :show, :create, :destroy]
    api.resources :user_properties, :only => [:index, :show, :create, :destroy], :requirements => { :id => /.*/ }
    api.resources :projects, :only => [:index, :destroy], :requirements => { :id => /.*/ }
    api.resources :favourites, :only => [:index, :show, :create, :destroy], :requirements => { :id => /.*/ }
    api.resources :manual_measures, :only => [:index, :create, :destroy], :requirements => { :id => /.*/ }
  end

  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 }
  map.connect 'api/metrics/:id', :controller => 'api/metrics', :action => 'update', :conditions => { :method => :put }
  map.connect 'api/metrics/:id', :controller => 'api/metrics', :action => 'destroy', :conditions => { :method => :delete }
  map.connect 'api/server/:action', :controller => 'api/server'
  map.connect 'api/resoures', :controller => 'api/resources', :action => 'index'
  map.connect 'api/sources', :controller => 'api/sources', :action => 'index'

  map.resources 'properties', :path_prefix => 'api', :controller => 'api/properties', :requirements => { :id => /.*/ }

  # home page
  map.home '', :controller => :dashboard, :action => :index
  map.root :controller => :dashboard, :action => :index

  # page plugins
  map.connect 'plugins/configuration/:page', :controller => 'plugins/configuration', :action => 'index', :requirements => { :page => /.*/ }
  map.connect 'plugins/home/:page', :controller => 'plugins/home', :action => 'index', :requirements => { :page => /.*/ }
  map.connect 'plugins/resource/:id', :controller => 'plugins/resource', :action => 'index', :requirements => { :id => /.*/ }

  # to refactor
  map.connect 'charts/:action/:project_id/:metric_id', :controller => 'charts'
  map.connect 'rules_configuration/:action/:language/:name/:plugin.:format', :controller => 'rules_configuration'

  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id', :requirements => { :id => /.*/ }

end