routes.rb 2.87 KB
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1
require 'sidekiq/web'
2
require 'sidekiq/cron/web'
Dmitriy Zaporozhets's avatar
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 17 18 19
  favicon_redirect = redirect do |_params, _request|
    ActionController::Base.helpers.asset_url(Gitlab::Favicon.main)
  end
  get 'favicon.png', to: favicon_redirect
  get 'favicon.ico', to: favicon_redirect

20 21 22
  draw :sherlock
  draw :development
  draw :ci
23

Valery Sizov's avatar
Valery Sizov committed
24
  use_doorkeeper do
25 26 27
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
Valery Sizov's avatar
Valery Sizov committed
28
  end
29

30 31
  use_doorkeeper_openid_connect

32 33 34
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'
35
  get '/autocomplete/projects' => 'autocomplete#projects'
Hiroyuki Sato's avatar
Hiroyuki Sato committed
36
  get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
37

38
  # Search
39 40
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
Valery Sizov's avatar
Valery Sizov committed
41

Kamil Trzcinski's avatar
Kamil Trzcinski committed
42 43 44
  # JSON Web Token
  get 'jwt/auth' => 'jwt#auth'

45
  # Health check
46
  get 'health_check(/:checks)' => 'health_check#index', as: :health_check
47

48 49 50
  scope path: '-' do
    get 'liveness' => 'health#liveness'
    get 'readiness' => 'health#readiness'
51
    post 'storage_check' => 'health#storage_check'
52
    resources :metrics, only: [:index]
53
    mount Peek::Railtie => '/peek', as: 'peek_routes'
54 55 56 57 58 59 60 61 62 63 64 65 66

    # Boards resources shared between group and projects
    resources :boards, only: [] do
      resources :lists, module: :boards, only: [:index, :create, :update, :destroy] do
        collection do
          post :generate
        end

        resources :issues, only: [:index, :create, :update]
      end

      resources :issues, module: :boards, only: [:index, :update]
    end
67

68 69
    # UserCallouts
    resources :user_callouts, only: [:create]
Phil Hughes's avatar
Phil Hughes committed
70 71 72

    get 'ide' => 'ide#index'
    get 'ide/*vueroute' => 'ide#index', format: false
73 74

    draw :instance_statistics
75 76
  end

77 78 79
  # Koding route
  get 'koding' => 'koding#index'

80 81 82 83
  draw :api
  draw :sidekiq
  draw :help
  draw :snippets
Andrew8xx8's avatar
Andrew8xx8 committed
84

Douwe Maan's avatar
Douwe Maan committed
85 86 87 88
  # Invites
  resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
    member do
      post :accept
Douwe Maan's avatar
Douwe Maan committed
89
      match :decline, via: [:get, :post]
Douwe Maan's avatar
Douwe Maan committed
90 91
    end
  end
92

93
  resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
94 95 96 97 98
    member do
      get :unsubscribe
    end
  end

99 100 101
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

102 103 104
  # Notification settings
  resources :notification_settings, only: [:create, :update]

105
  draw :google_api
106 107 108 109 110 111 112 113 114
  draw :import
  draw :uploads
  draw :explore
  draw :admin
  draw :profile
  draw :dashboard
  draw :group
  draw :user
  draw :project
gitlabhq's avatar
gitlabhq committed
115

116
  root to: "root#index"
117

118
  get '*unmatched_route', to: 'application#route_not_found'
gitlabhq's avatar
gitlabhq committed
119
end