diff options
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/api.rb | 2 | ||||
-rw-r--r-- | config/routes/ci.rb | 15 | ||||
-rw-r--r-- | config/routes/development.rb | 13 | ||||
-rw-r--r-- | config/routes/help.rb | 4 | ||||
-rw-r--r-- | config/routes/sherlock.rb | 12 | ||||
-rw-r--r-- | config/routes/sidekiq.rb | 4 | ||||
-rw-r--r-- | config/routes/snippets.rb | 8 |
7 files changed, 58 insertions, 0 deletions
diff --git a/config/routes/api.rb b/config/routes/api.rb new file mode 100644 index 00000000000..69c8efc151c --- /dev/null +++ b/config/routes/api.rb @@ -0,0 +1,2 @@ +API::API.logger Rails.logger +mount API::API => '/api' diff --git a/config/routes/ci.rb b/config/routes/ci.rb new file mode 100644 index 00000000000..47a049d5b20 --- /dev/null +++ b/config/routes/ci.rb @@ -0,0 +1,15 @@ +namespace :ci do + # CI API + Ci::API::API.logger Rails.logger + mount Ci::API::API => '/api' + + resource :lint, only: [:show, :create] + + resources :projects, only: [:index, :show] do + member do + get :status, to: 'projects#badge' + end + end + + root to: 'projects#index' +end diff --git a/config/routes/development.rb b/config/routes/development.rb new file mode 100644 index 00000000000..9b2b47c6a21 --- /dev/null +++ b/config/routes/development.rb @@ -0,0 +1,13 @@ +if Rails.env.development? + # Make the built-in Rails routes available in development, otherwise they'd + # get swallowed by the `namespace/project` route matcher below. + # + # See https://git.io/va79N + get '/rails/mailers' => 'rails/mailers#index' + get '/rails/mailers/:path' => 'rails/mailers#preview' + get '/rails/info/properties' => 'rails/info#properties' + get '/rails/info/routes' => 'rails/info#routes' + get '/rails/info' => 'rails/info#index' + + mount LetterOpenerWeb::Engine, at: '/rails/letter_opener' +end diff --git a/config/routes/help.rb b/config/routes/help.rb new file mode 100644 index 00000000000..d53822da9ec --- /dev/null +++ b/config/routes/help.rb @@ -0,0 +1,4 @@ +get 'help' => 'help#index' +get 'help/shortcuts' => 'help#shortcuts' +get 'help/ui' => 'help#ui' +get 'help/*path' => 'help#show', as: :help_page diff --git a/config/routes/sherlock.rb b/config/routes/sherlock.rb new file mode 100644 index 00000000000..c9969f91c36 --- /dev/null +++ b/config/routes/sherlock.rb @@ -0,0 +1,12 @@ +if Gitlab::Sherlock.enabled? + namespace :sherlock do + resources :transactions, only: [:index, :show] do + resources :queries, only: [:show] + resources :file_samples, only: [:show] + + collection do + delete :destroy_all + end + end + end +end diff --git a/config/routes/sidekiq.rb b/config/routes/sidekiq.rb new file mode 100644 index 00000000000..d3e6bc4c292 --- /dev/null +++ b/config/routes/sidekiq.rb @@ -0,0 +1,4 @@ +constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? } +constraints constraint do + mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq +end diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb new file mode 100644 index 00000000000..1949f215c66 --- /dev/null +++ b/config/routes/snippets.rb @@ -0,0 +1,8 @@ +resources :snippets, concerns: :awardable do + member do + get 'raw' + end +end + +get '/s/:username', to: redirect('/u/%{username}/snippets'), + constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } |