Welcome to mirror list, hosted at ThFree Co, Russian Federation.

snippets.rb « routes « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ea9a6431d819c92a887b53b5feaeff8495c65f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
resources :snippets, concerns: :awardable do
  member do
    get :raw
    post :mark_as_spam
  end

  collection do
    post :preview_markdown
  end

  scope module: :snippets do
    resources :notes, only: [:index, :create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do
      member do
        delete :delete_attachment
      end
    end
  end
end

# Use this /-/ scope for all new snippet routes.
scope path: '-' do
  get '/snippets/:snippet_id/raw/:ref/*path',
    to: 'snippets/blobs#raw',
    as: :snippet_blob_raw,
    format: false,
    constraints: { snippet_id: /\d+/ }
end

get '/s/:username', to: redirect('users/%{username}/snippets'),
                    constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }