Merge pull request #2348 from betagouv/document-routes
Sépare les routes par section
This commit is contained in:
commit
63866a47b5
1 changed files with 49 additions and 6 deletions
|
@ -1,4 +1,8 @@
|
|||
Rails.application.routes.draw do
|
||||
#
|
||||
# Manager
|
||||
#
|
||||
|
||||
get 'manager/sign_in' => 'administrations/sessions#new'
|
||||
delete 'manager/sign_out' => 'administrations/sessions#destroy'
|
||||
namespace :manager do
|
||||
|
@ -38,8 +42,16 @@ Rails.application.routes.draw do
|
|||
root to: "administrateurs#index"
|
||||
end
|
||||
|
||||
#
|
||||
# Monitoring
|
||||
#
|
||||
|
||||
get "/ping" => "ping#index", :constraints => { :ip => /127.0.0.1/ }
|
||||
|
||||
#
|
||||
# Authentication
|
||||
#
|
||||
|
||||
devise_for :administrations,
|
||||
skip: [:password, :registrations, :sessions],
|
||||
controllers: {
|
||||
|
@ -77,6 +89,10 @@ Rails.application.routes.draw do
|
|||
get '/administrateurs/sign_in/demo' => redirect("/users/sign_in")
|
||||
end
|
||||
|
||||
#
|
||||
# Main routes
|
||||
#
|
||||
|
||||
root 'root#index'
|
||||
|
||||
get 'users' => 'users#index'
|
||||
|
@ -95,6 +111,17 @@ Rails.application.routes.draw do
|
|||
get ':champ_id/siret' => 'siret#index', as: 'siret'
|
||||
end
|
||||
|
||||
namespace :commencer do
|
||||
get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test
|
||||
get '/:procedure_path' => '/users/dossiers#commencer'
|
||||
end
|
||||
|
||||
get "patron" => "root#patron"
|
||||
|
||||
#
|
||||
# Deprecated UI
|
||||
#
|
||||
|
||||
namespace :users do
|
||||
namespace :dossiers do
|
||||
resources :invites, only: [:index, :show]
|
||||
|
@ -206,6 +233,10 @@ Rails.application.routes.draw do
|
|||
resources :gestionnaires, only: [:index, :create, :destroy]
|
||||
end
|
||||
|
||||
#
|
||||
# Addresses
|
||||
#
|
||||
|
||||
namespace :ban do
|
||||
get 'search' => 'search#get'
|
||||
get 'address_point' => 'search#get_address_point'
|
||||
|
@ -215,6 +246,10 @@ Rails.application.routes.draw do
|
|||
post 'dossier/:dossier_id' => '/invites#create', as: 'dossier'
|
||||
end
|
||||
|
||||
#
|
||||
# API
|
||||
#
|
||||
|
||||
namespace :api do
|
||||
namespace :v1 do
|
||||
resources :procedures, only: [:index, :show] do
|
||||
|
@ -227,12 +262,9 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
namespace :commencer do
|
||||
get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test
|
||||
get '/:procedure_path' => '/users/dossiers#commencer'
|
||||
end
|
||||
|
||||
get "patron" => "root#patron"
|
||||
#
|
||||
# User
|
||||
#
|
||||
|
||||
scope module: 'new_user' do
|
||||
resources :dossiers, only: [:index, :update] do
|
||||
|
@ -252,6 +284,10 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Gestionnaire
|
||||
#
|
||||
|
||||
scope module: 'new_gestionnaire', as: 'gestionnaire' do
|
||||
resources :procedures, only: [:index, :show], param: :procedure_id do
|
||||
member do
|
||||
|
@ -301,6 +337,10 @@ Rails.application.routes.draw do
|
|||
get "recherche" => "recherche#index"
|
||||
end
|
||||
|
||||
#
|
||||
# Administrateur
|
||||
#
|
||||
|
||||
scope module: 'new_administrateur' do
|
||||
resources :procedures, only: [] do
|
||||
member do
|
||||
|
@ -317,7 +357,10 @@ Rails.application.routes.draw do
|
|||
|
||||
apipie
|
||||
|
||||
#
|
||||
# Legacy routes
|
||||
#
|
||||
|
||||
get 'backoffice' => redirect('/procedures')
|
||||
get 'backoffice/sign_in' => redirect('/users/sign_in')
|
||||
get 'backoffice/dossiers/procedure/:procedure_id' => redirect('/procedures/%{procedure_id}')
|
||||
|
|
Loading…
Reference in a new issue