gitlab-org--gitlab-foss/config/routes/snippets.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
766 B
Ruby
Raw Normal View History

# frozen_string_literal: true
resources :snippets, except: [:create, :update, :destroy], concerns: :awardable, constraints: { id: /\d+/ } do
member do
get :raw
post :mark_as_spam
2017-05-03 11:26:49 -04:00
end
collection do
post :preview_markdown
end
2017-04-27 06:41:26 -04:00
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
get '/snippets/:snippet_id/raw/:ref/*path',
to: 'snippets/blobs#raw',
as: :snippet_blob_raw,
format: false,
constraints: { snippet_id: /\d+/ }
get '/s/:username', to: redirect('users/%{username}/snippets'),
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }