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

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

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

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

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

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

Annabel Dunstone's avatar
Annabel Dunstone committed
30
31
  # Emojis
  resources :emojis, only: :index
32

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

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

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

43
44
45
  # Koding route
  get 'koding' => 'koding#index'

46
47
48
49
  draw :api
  draw :sidekiq
  draw :help
  draw :snippets
Andrew8xx8's avatar
Andrew8xx8 committed
50

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

59
  resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
60
61
62
63
64
    member do
      get :unsubscribe
    end
  end

65
66
67
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

68
69
70
  # Notification settings
  resources :notification_settings, only: [:create, :update]

71
72
73
74
75
76
77
78
79
  draw :import
  draw :uploads
  draw :explore
  draw :admin
  draw :profile
  draw :dashboard
  draw :group
  draw :user
  draw :project
gitlabhq's avatar
gitlabhq committed
80

81
82
83
  # Get all keys of user
  get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }

84
  root to: "root#index"
85
86

  get '*unmatched_route', to: 'application#not_found'
gitlabhq's avatar
gitlabhq committed
87
end