debian-mirror-gitlab/config/routes.rb

106 lines
2.4 KiB
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
require 'sidekiq/web'
2015-12-23 02:04:40 +05:30
require 'sidekiq/cron/web'
2017-08-17 22:00:37 +05:30
require 'constraints/group_url_constrainer'
2016-06-02 11:05:42 +05:30
2016-11-03 12:29:30 +05:30
Rails.application.routes.draw do
concern :access_requestable do
post :request_access, on: :collection
post :approve_access_request, on: :member
end
2016-09-29 09:46:39 +05:30
concern :awardable do
post :toggle_award_emoji, on: :member
end
2016-11-03 12:29:30 +05:30
draw :sherlock
draw :development
draw :ci
2015-09-25 12:07:36 +05:30
2015-04-26 12:48:37 +05:30
use_doorkeeper do
controllers applications: 'oauth/applications',
authorized_applications: 'oauth/authorized_applications',
authorizations: 'oauth/authorizations'
end
2017-08-17 22:00:37 +05:30
use_doorkeeper_openid_connect
2015-04-26 12:48:37 +05:30
# Autocomplete
get '/autocomplete/users' => 'autocomplete#users'
get '/autocomplete/users/:id' => 'autocomplete#user'
get '/autocomplete/projects' => 'autocomplete#projects'
2015-04-26 12:48:37 +05:30
2014-09-02 18:07:02 +05:30
# Search
2015-04-26 12:48:37 +05:30
get 'search' => 'search#show'
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
2014-09-02 18:07:02 +05:30
2016-06-02 11:05:42 +05:30
# JSON Web Token
get 'jwt/auth' => 'jwt#auth'
# Health check
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
2017-08-17 22:00:37 +05:30
scope path: '-', controller: 'health' do
get :liveness
get :readiness
get :metrics
end
2016-09-13 17:45:13 +05:30
# Koding route
get 'koding' => 'koding#index'
2016-11-03 12:29:30 +05:30
draw :api
draw :sidekiq
draw :help
draw :snippets
2015-04-26 12:48:37 +05:30
# Invites
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
member do
post :accept
match :decline, via: [:get, :post]
end
end
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
member do
get :unsubscribe
end
end
2015-09-11 14:41:01 +05:30
# Spam reports
resources :abuse_reports, only: [:new, :create]
2016-06-22 15:30:34 +05:30
# Notification settings
resources :notification_settings, only: [:create, :update]
2016-11-03 12:29:30 +05:30
draw :import
draw :uploads
draw :explore
draw :admin
draw :profile
draw :dashboard
draw :group
draw :user
draw :project
2014-09-02 18:07:02 +05:30
2016-11-03 12:29:30 +05:30
root to: "root#index"
2017-08-17 22:00:37 +05:30
# Since group show page is wildcard routing
# we want all other routing to be checked before matching this one
constraints(GroupUrlConstrainer.new) do
scope(path: '*id',
as: :group,
constraints: { id: Gitlab::Regex.namespace_route_regex, format: /(html|json|atom)/ },
controller: :groups) do
get '/', action: :show
patch '/', action: :update
put '/', action: :update
delete '/', action: :destroy
end
end
draw :test if Rails.env.test?
get '*unmatched_route', to: 'application#route_not_found'
2014-09-02 18:07:02 +05:30
end