Read about our upcoming Code of Conduct on this issue

routes.rb 1.92 KB
Newer Older
Dmitriy Zaporozhets's avatar
sidekiq    
Dmitriy Zaporozhets committed
1
require 'sidekiq/web'
2
require 'sidekiq/cron/web'
Dmitriy Zaporozhets's avatar
sidekiq    
Dmitriy Zaporozhets committed
3

Valery Sizov's avatar
Valery Sizov committed
4
Rails.application.routes.draw do
5
6
  concern :access_requestable do
    post :request_access, on: :collection
7
    post :approve_access_request, on: :member
8
9
  end

10
11
12
13
  concern :awardable do
    post :toggle_award_emoji, on: :member
  end

14
15
16
  draw :sherlock
  draw :development
  draw :ci
Douwe Maan's avatar
Douwe Maan committed
17

Valery Sizov's avatar
Valery Sizov committed
18
  use_doorkeeper do
19
20
21
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
Valery Sizov's avatar
Valery Sizov committed
22
  end
23

24
25
  use_doorkeeper_openid_connect

26
27
28
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'
Phil Hughes's avatar
Phil Hughes committed
29
  get '/autocomplete/projects' => 'autocomplete#projects'
30

31
  # Search
32
33
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
Valery Sizov's avatar
Valery Sizov committed
34

Kamil Trzcinski's avatar
Kamil Trzcinski committed
35
36
37
  # JSON Web Token
  get 'jwt/auth' => 'jwt#auth'

38
  # Health check
39
  get 'health_check(/:checks)' => 'health_check#index', as: :health_check
40

41
42
43
44
45
46
  scope path: '-', controller: 'health' do
    get :liveness
    get :readiness
    get :metrics
  end

47
48
49
  # Koding route
  get 'koding' => 'koding#index'

50
51
52
53
  draw :api
  draw :sidekiq
  draw :help
  draw :snippets
Andrew8xx8's avatar
Andrew8xx8 committed
54

Douwe Maan's avatar
Douwe Maan committed
55
56
57
58
  # Invites
  resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
    member do
      post :accept
Douwe Maan's avatar
Douwe Maan committed
59
      match :decline, via: [:get, :post]
Douwe Maan's avatar
Douwe Maan committed
60
61
    end
  end
62

63
  resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
64
65
66
67
68
    member do
      get :unsubscribe
    end
  end

69
70
71
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

72
73
74
  # Notification settings
  resources :notification_settings, only: [:create, :update]

75
76
77
78
79
80
81
82
83
  draw :import
  draw :uploads
  draw :explore
  draw :admin
  draw :profile
  draw :dashboard
  draw :group
  draw :user
  draw :project
gitlabhq's avatar
gitlabhq committed
84

85
  root to: "root#index"
86

87
88
  draw :test if Rails.env.test?

89
  get '*unmatched_route', to: 'application#route_not_found'
gitlabhq's avatar
gitlabhq committed
90
end