routes.rb 18.1 KB
Newer Older
D
sidekiq  
Dmitriy Zaporozhets 已提交
1
require 'sidekiq/web'
2
require 'api/api'
D
sidekiq  
Dmitriy Zaporozhets 已提交
3

G
gitlabhq 已提交
4
Gitlab::Application.routes.draw do
5 6 7 8 9 10 11 12 13 14 15 16 17
  if Gitlab::Sherlock.enabled?
    namespace :sherlock do
      resources :transactions, only: [:index, :show] do
        resources :queries, only: [:show]
        resources :file_samples, only: [:show]

        collection do
          delete :destroy_all
        end
      end
    end
  end

D
Douwe Maan 已提交
18 19 20 21 22 23 24 25 26 27
  namespace :ci do
    # CI API
    Ci::API::API.logger Rails.logger
    mount Ci::API::API => '/api'

    resource :lint, only: [:show, :create]

    resources :projects do
      collection do
        post :add
K
Kamil Trzcinski 已提交
28
        get :disabled
D
Douwe Maan 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
      end

      member do
        get :status, to: 'projects#badge'
        get :integration
        post :toggle_shared_runners
      end

      resources :runner_projects, only: [:create, :destroy]
    end

    resource :user_sessions do
      get :auth
      get :callback
    end

    namespace :admin do
      resources :runners, only: [:index, :show, :update, :destroy] do
        member do
          put :assign_all
          get :resume
          get :pause
        end
      end

      resources :events, only: [:index]

      resources :projects do
        resources :runner_projects
      end

      resources :builds, only: :index

      resource :application_settings, only: [:show, :update]
    end

    root to: 'projects#index'
  end

V
Valery Sizov 已提交
68
  use_doorkeeper do
69 70 71
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
V
Valery Sizov 已提交
72
  end
73

74 75 76 77 78
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'


79
  # Search
80 81
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
V
Valery Sizov 已提交
82

83
  # API
84 85
  API::API.logger Rails.logger
  mount API::API => '/api'
86

G
GitLab 已提交
87
  # Get all keys of user
88 89
  get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }

90
  constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? }
D
sidekiq  
Dmitriy Zaporozhets 已提交
91
  constraints constraint do
92
    mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
D
sidekiq  
Dmitriy Zaporozhets 已提交
93
  end
A
Ariejan de Vroom 已提交
94

95
  # Enable Grack support
96
  mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
97

98
  # Help
J
Job van der Voort 已提交
99
  get 'help'                  => 'help#index'
100
  get 'help/:category/:file'  => 'help#show', as: :help_page, constraints: { category: /.*/, file: /[^\/\.]+/ }
M
Marin Jankovski 已提交
101
  get 'help/shortcuts'
102
  get 'help/ui'               => 'help#ui'
103

A
Andrew8xx8 已提交
104 105 106 107 108
  #
  # Global snippets
  #
  resources :snippets do
    member do
109
      get 'raw'
A
Andrew8xx8 已提交
110 111
    end
  end
112 113

  get '/s/:username' => 'snippets#index', as: :user_snippets, constraints: { username: /.*/ }
A
Andrew8xx8 已提交
114

D
Douwe Maan 已提交
115 116 117 118 119 120 121
  #
  # Invites
  #

  resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
    member do
      post :accept
D
Douwe Maan 已提交
122
      match :decline, via: [:get, :post]
D
Douwe Maan 已提交
123 124
    end
  end
M
Marin Jankovski 已提交
125

126 127 128
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

V
Valery Sizov 已提交
129
  #
130
  # Import
V
Valery Sizov 已提交
131
  #
132 133
  namespace :import do
    resource :github, only: [:create, :new], controller: :github do
V
Valery Sizov 已提交
134 135 136 137 138
      get :status
      get :callback
      get :jobs
    end

139
    resource :gitlab, only: [:create, :new], controller: :gitlab do
V
Valery Sizov 已提交
140 141 142 143
      get :status
      get :callback
      get :jobs
    end
M
Marcin Kulik 已提交
144

D
Douwe Maan 已提交
145 146 147 148 149
    resource :bitbucket, only: [:create, :new], controller: :bitbucket do
      get :status
      get :callback
      get :jobs
    end
150

M
Marcin Kulik 已提交
151 152 153 154 155
    resource :gitorious, only: [:create, :new], controller: :gitorious do
      get :status
      get :callback
      get :jobs
    end
156 157 158 159 160

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
D
Douwe Maan 已提交
161 162 163

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
164
    end
J
Jared Szechy 已提交
165 166 167 168 169 170 171 172 173

    resource :fogbugz, only: [:create, :new], controller: :fogbugz do
      get :status
      post :callback
      get :jobs

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
    end
V
Valery Sizov 已提交
174
  end
M
Marin Jankovski 已提交
175

176 177 178
  #
  # Uploads
  #
M
Marin Jankovski 已提交
179

180 181
  scope path: :uploads do
    # Note attachments and User/Group/Project avatars
182 183
    get ":model/:mounted_as/:id/:filename",
        to:           "uploads#show",
184
        constraints:  { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ }
185 186

    # Project markdown uploads
187
    get ":namespace_id/:project_id/:secret/:filename",
188
      to:           "projects/uploads#show",
189
      constraints:  { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ }
190
  end
V
Valery Sizov 已提交
191

192
  # Redirect old note attachments path to new uploads path.
193 194
  get "files/note/:id/:filename",
    to:           redirect("uploads/note/attachment/%{id}/%{filename}"),
195
    constraints:  { filename: /[^\/]+/ }
196

197
  #
Y
Yatish Mehta 已提交
198
  # Explore area
199
  #
D
Dmitriy Zaporozhets 已提交
200 201 202 203
  namespace :explore do
    resources :projects, only: [:index] do
      collection do
        get :trending
204
        get :starred
D
Dmitriy Zaporozhets 已提交
205 206 207
      end
    end

208
    resources :groups, only: [:index]
209
    resources :snippets, only: [:index]
210
    root to: 'projects#trending'
211 212
  end

D
Dmitriy Zaporozhets 已提交
213
  # Compatibility with old routing
214 215
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
D
Dmitriy Zaporozhets 已提交
216

217 218 219
  #
  # Admin Area
  #
N
Nihad Abbasov 已提交
220
  namespace :admin do
221
    resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
222
      resources :keys, only: [:show, :destroy]
223
      resources :identities, only: [:index, :edit, :update, :destroy]
224

225
      member do
D
Dmitriy Zaporozhets 已提交
226 227 228
        get :projects
        get :keys
        get :groups
D
Dmitriy Zaporozhets 已提交
229
        put :team_update
230 231
        put :block
        put :unblock
232
        put :unlock
233
        put :confirm
234
        post :login_as
235
        patch :disable_two_factor
236
        delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
D
Dmitriy Zaporozhets 已提交
237 238
      end
    end
A
Andrey Kumanyaev 已提交
239

240
    resources :abuse_reports, only: [:index, :destroy]
V
Valery Sizov 已提交
241 242
    resources :applications

243 244
    resources :groups, constraints: { id: /[^\/]+/ } do
      member do
245
        put :members_update
246
      end
A
Andrey Kumanyaev 已提交
247
    end
A
Andrey Kumanyaev 已提交
248

249
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
250

R
Robert Speicher 已提交
251
    resources :hooks, only: [:index, :create, :destroy] do
V
Valeriy Sizov 已提交
252 253
      get :test
    end
A
Andrey Kumanyaev 已提交
254

255
    resources :broadcast_messages, only: [:index, :create, :destroy]
256
    resource :logs, only: [:show]
257
    resource :background_jobs, controller: 'background_jobs', only: [:show]
258

V
Vinnie Okada 已提交
259 260 261
    resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
      root to: 'projects#index', as: :projects

262 263
      resources(:projects,
                path: '/',
V
Vinnie Okada 已提交
264 265 266 267 268 269 270
                constraints: { id: /[a-zA-Z.0-9_\-]+/ },
                only: [:index, :show]) do
        root to: 'projects#show'

        member do
          put :transfer
        end
271 272 273
      end
    end

M
Marin Jankovski 已提交
274 275 276
    resource :application_settings, only: [:show, :update] do
      resources :services
    end
277

V
Valery Sizov 已提交
278 279
    resources :labels

280
    root to: 'dashboard#index'
G
gitlabhq 已提交
281 282
  end

R
randx 已提交
283 284 285
  #
  # Profile Area
  #
286 287
  resource :profile, only: [:show, :update] do
    member do
V
Valery Sizov 已提交
288
      get :audit_log
D
Dmitriy Zaporozhets 已提交
289
      get :applications
290 291 292 293

      put :reset_private_token
      put :update_username
    end
D
Dmitriy Zaporozhets 已提交
294

295
    scope module: :profiles do
296 297 298 299 300
      resource :account, only: [:show, :update] do
        member do
          delete :unlink
        end
      end
301
      resource :notifications, only: [:show, :update]
302 303 304 305 306
      resource :password, only: [:new, :create, :edit, :update] do
        member do
          put :reset
        end
      end
307
      resource :preferences, only: [:show, :update]
308
      resources :keys
309
      resources :emails, only: [:index, :create, :destroy]
310
      resource :avatar, only: [:destroy]
311 312
      resource :two_factor_auth, only: [:new, :create, :destroy] do
        member do
313
          post :codes
314 315
        end
      end
316
    end
317
  end
R
Robert Speicher 已提交
318

319
  get 'u/:username/calendar' => 'users#calendar', as: :user_calendar,
320 321 322 323
      constraints: { username: /.*/ }

  get 'u/:username/calendar_activities' => 'users#calendar_activities', as: :user_calendar_activities,
      constraints: { username: /.*/ }
324

325
  get '/u/:username' => 'users#show', as: :user,
D
Douwe Maan 已提交
326
      constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
D
Dmitriy Zaporozhets 已提交
327

R
randx 已提交
328 329 330
  #
  # Dashboard Area
  #
331 332 333 334
  resource :dashboard, controller: 'dashboard', only: [] do
    get :issues
    get :merge_requests
    get :activity
D
Douwe Maan 已提交
335 336 337

    scope module: :dashboard do
      resources :milestones, only: [:index, :show]
338

339
      resources :groups, only: [:index]
340
      resources :snippets, only: [:index]
341

342
      resources :projects, only: [:index] do
343 344 345 346
        collection do
          get :starred
        end
      end
D
Douwe Maan 已提交
347
    end
348 349

    root to: "dashboard/projects#index"
D
Dmitriy Zaporozhets 已提交
350
  end
G
gitlabhq 已提交
351

R
randx 已提交
352 353 354
  #
  # Groups Area
  #
D
Douwe Maan 已提交
355
  resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }  do
R
randx 已提交
356 357 358
    member do
      get :issues
      get :merge_requests
D
Dmitriy Zaporozhets 已提交
359
      get :projects
R
randx 已提交
360
    end
361

S
Steven Thonus 已提交
362
    scope module: :groups do
363
      resources :group_members, only: [:index, :create, :update, :destroy] do
364
        post :resend_invite, on: :member
365
        delete :leave, on: :collection
366
      end
367

S
Steven Thonus 已提交
368
      resource :avatar, only: [:destroy]
D
Douwe Maan 已提交
369
      resources :milestones, only: [:index, :show, :update]
S
Steven Thonus 已提交
370
    end
R
randx 已提交
371 372
  end

373
  resources :projects, constraints: { id: /[^\/]+/ }, only: [:index, :new, :create]
374

375
  devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations }
G
gitlabhq 已提交
376

377
  devise_scope :user do
378
    get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
379
  end
V
Vinnie Okada 已提交
380

381
  root to: "root#index"
V
Vinnie Okada 已提交
382

383 384 385
  #
  # Project Area
  #
V
Vinnie Okada 已提交
386
  resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
D
Douwe Maan 已提交
387
    resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except:
V
Vinnie Okada 已提交
388 389 390
              [:new, :create, :index], path: "/") do
      member do
        put :transfer
391
        delete :remove_fork
V
Vinnie Okada 已提交
392 393 394 395 396
        post :archive
        post :unarchive
        post :toggle_star
        post :markdown_preview
        get :autocomplete_sources
397
        get :activity
S
skv 已提交
398
      end
399

V
Vinnie Okada 已提交
400 401 402 403 404 405 406 407 408
      scope module: :projects do
        # Blob routes:
        get '/new/*id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob'
        post '/create/*id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob'
        get '/edit/*id', to: 'blob#edit', constraints: { id: /.+/ }, as: 'edit_blob'
        put '/update/*id', to: 'blob#update', constraints: { id: /.+/ }, as: 'update_blob'
        post '/preview/*id', to: 'blob#preview', constraints: { id: /.+/ }, as: 'preview_blob'

        scope do
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
          get(
            '/blob/*id/diff',
            to: 'blob#diff',
            constraints: { id: /.+/, format: false },
            as: :blob_diff
          )
          get(
            '/blob/*id',
            to: 'blob#show',
            constraints: { id: /.+/, format: false },
            as: :blob
          )
          delete(
            '/blob/*id',
            to: 'blob#destroy',
            constraints: { id: /.+/, format: false }
          )
L
liyakun 已提交
426 427 428 429 430 431 432 433 434 435
          put(
            '/blob/*id',
            to: 'blob#update',
            constraints: { id: /.+/, format: false }
          )
          post(
            '/blob/*id',
            to: 'blob#create',
            constraints: { id: /.+/, format: false }
          )
V
Vinnie Okada 已提交
436
        end
437

V
Vinnie Okada 已提交
438 439 440 441 442 443 444
        scope do
          get(
            '/raw/*id',
            to: 'raw#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :raw
          )
445
        end
446

V
Vinnie Okada 已提交
447 448 449 450 451 452 453 454 455
        scope do
          get(
            '/tree/*id',
            to: 'tree#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :tree
          )
        end

S
Stan Hu 已提交
456 457 458 459 460 461 462 463 464
        scope do
          post(
              '/create_dir/*id',
              to: 'tree#create_dir',
              constraints: { id: /.+/ },
              as: 'create_dir'
          )
        end

V
Vinnie Okada 已提交
465 466 467 468 469 470 471
        scope do
          get(
            '/blame/*id',
            to: 'blame#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :blame
          )
472
        end
D
Dmitriy Zaporozhets 已提交
473

474 475 476 477
        scope do
          get(
            '/commits/*id',
            to: 'commits#show',
D
Dmitriy Zaporozhets 已提交
478
            constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ },
479 480 481 482 483 484
            as: :commits
          )
        end

        resource  :avatar, only: [:show, :destroy]
        resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
485 486
          member do
            get :branches
K
Kamil Trzcinski 已提交
487 488 489
            get :builds
            post :cancel_builds
            post :retry_builds
490
          end
491 492 493 494 495 496
        end

        resources :compare, only: [:index, :create]
        resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }

        resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
V
Vinnie Okada 已提交
497 498
          member do
            get :commits
499
            get :ci
V
Vinnie Okada 已提交
500
          end
501
        end
V
Valery Sizov 已提交
502

V
Vinnie Okada 已提交
503 504
        get '/compare/:from...:to' => 'compare#show', :as => 'compare',
            :constraints => { from: /.+/, to: /.+/ }
505

V
Vinnie Okada 已提交
506 507 508 509
        resources :snippets, constraints: { id: /\d+/ } do
          member do
            get 'raw'
          end
510
        end
511

S
Stan Hu 已提交
512
        WIKI_SLUG_ID = { id: /[a-zA-Z.0-9_\-\/]+/ } unless defined? WIKI_SLUG_ID
D
Dmitriy Zaporozhets 已提交
513

S
Stan Hu 已提交
514 515 516 517 518 519 520 521 522 523 524 525
        scope do
          # Order matters to give priority to these matches
          get '/wikis/git_access', to: 'wikis#git_access'
          get '/wikis/pages', to: 'wikis#pages', as: 'wiki_pages'
          post '/wikis', to: 'wikis#create'

          get '/wikis/*id/history', to: 'wikis#history', as: 'wiki_history', constraints: WIKI_SLUG_ID
          get '/wikis/*id/edit', to: 'wikis#edit', as: 'wiki_edit', constraints: WIKI_SLUG_ID

          get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
          delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
          put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
526
        end
527

V
Vinnie Okada 已提交
528 529 530 531 532
        resource :repository, only: [:show, :create] do
          member do
            get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
          end
        end
M
miks 已提交
533

V
Vinnie Okada 已提交
534 535 536 537
        resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
538
        end
G
gitlabhq 已提交
539

540
        resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
V
Vinnie Okada 已提交
541 542 543 544
          member do
            put :enable
            put :disable
          end
545
        end
G
gitlabhq 已提交
546

V
Vinnie Okada 已提交
547 548 549 550 551 552 553 554 555 556 557
        resource :fork, only: [:new, :create]
        resource :import, only: [:new, :create, :show]

        resources :refs, only: [] do
          collection do
            get 'switch'
          end

          member do
            # tree viewer logs
            get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex }
558 559
            # Directories with leading dots erroneously get rejected if git
            # ref regex used in constraints. Regex verification now done in controller.
560
            get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
561
              id: /.*/,
V
Vinnie Okada 已提交
562 563 564
              path: /.*/
            }
          end
565
        end
566

V
Vinnie Okada 已提交
567 568 569
        resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
          member do
            get :diffs
570
            get :commits
571 572
            post :merge
            get :merge_check
V
Vinnie Okada 已提交
573
            get :ci_status
V
tests  
Valery Sizov 已提交
574
            post :toggle_subscription
V
Vinnie Okada 已提交
575 576 577 578 579 580 581
          end

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
582
        end
583

V
Vinnie Okada 已提交
584
        resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
585 586
        resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
          resource :release, only: [:edit, :update]
587 588
        end

V
Vinnie Okada 已提交
589
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
590
        resource :variables, only: [:show, :update]
591
        resources :triggers, only: [:index, :create, :destroy]
592
        resource :ci_settings, only: [:edit, :update, :destroy]
593 594 595 596 597
        resources :ci_web_hooks, only: [:index, :create, :destroy] do
          member do
            get :test
          end
        end
V
Vinnie Okada 已提交
598

599 600 601 602 603 604
        resources :ci_services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
        end

K
Kamil Trzcinski 已提交
605 606
        resources :builds, only: [:index, :show] do
          collection do
K
Kamil Trzcinski 已提交
607
            post :cancel_all
K
Kamil Trzcinski 已提交
608 609
          end

610 611
          member do
            get :status
K
Kamil Trzcinski 已提交
612
            post :cancel
K
Kamil Trzcinski 已提交
613
            get :download
614 615 616
            post :retry
          end
        end
617

V
Vinnie Okada 已提交
618 619 620 621
        resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
          member do
            get :test
          end
622
        end
623

624
        resources :milestones, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
625 626 627 628
          member do
            put :sort_issues
            put :sort_merge_requests
          end
D
Dmitriy Zaporozhets 已提交
629
        end
630

V
Vinnie Okada 已提交
631 632 633 634
        resources :labels, constraints: { id: /\d+/ } do
          collection do
            post :generate
          end
635
        end
636

V
Vinnie Okada 已提交
637
        resources :issues, constraints: { id: /\d+/ }, except: [:destroy] do
V
Valery Sizov 已提交
638
          member do
V
tests  
Valery Sizov 已提交
639
            post :toggle_subscription
V
Valery Sizov 已提交
640
          end
V
Vinnie Okada 已提交
641 642 643
          collection do
            post  :bulk_update
          end
644
        end
R
Robert Speicher 已提交
645

646
        resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do
V
Vinnie Okada 已提交
647 648
          collection do
            delete :leave
D
Dmitriy Zaporozhets 已提交
649

V
Vinnie Okada 已提交
650 651 652 653 654
            # Used for import team
            # from another project
            get :import
            post :apply_import
          end
655 656 657 658

          member do
            post :resend_invite
          end
659
        end
D
Dmitriy Zaporozhets 已提交
660

J
Jason Lee 已提交
661
        resources :notes, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
662 663 664
          member do
            delete :delete_attachment
          end
665
        end
666 667 668

        resources :uploads, only: [:create] do
          collection do
669
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
670
          end
671
        end
672

673 674 675 676 677 678 679
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
        end
      end
680
    end
G
gitlabhq 已提交
681
  end
R
Robert Speicher 已提交
682

683
  get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
G
gitlabhq 已提交
684
end