BigW Consortium Gitlab

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

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
17

Valery Sizov committed
18
  use_doorkeeper do
19 20 21
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
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'
29
  get '/autocomplete/projects' => 'autocomplete#projects'
30
  get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
31

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

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

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

42 43 44
  scope path: '-' do
    get 'liveness' => 'health#liveness'
    get 'readiness' => 'health#readiness'
45
    resources :metrics, only: [:index]
46
    mount Peek::Railtie => '/peek'
47 48
  end

49 50 51
  # Koding route
  get 'koding' => 'koding#index'

52 53 54 55
  draw :api
  draw :sidekiq
  draw :help
  draw :snippets
Andrew8xx8 committed
56

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

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

71 72 73
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

74 75 76
  # Notification settings
  resources :notification_settings, only: [:create, :update]

77 78 79 80 81 82 83 84 85 86 87 88 89
  # Boards resources shared between group and projects
  resources :boards 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

90 91 92 93 94 95 96 97 98
  draw :import
  draw :uploads
  draw :explore
  draw :admin
  draw :profile
  draw :dashboard
  draw :group
  draw :user
  draw :project
gitlabhq committed
99

100
  root to: "root#index"
101

102 103
  draw :test if Rails.env.test?

104
  get '*unmatched_route', to: 'application#route_not_found'
gitlabhq committed
105
end