summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 7bf6c03e69b..03b47261e7e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,7 @@
require 'sidekiq/web'
require 'sidekiq/cron/web'
require 'api/api'
+require 'constraints/group_url_constrainer'
Rails.application.routes.draw do
concern :access_requestable do
@@ -78,10 +79,21 @@ Rails.application.routes.draw do
draw :user
draw :project
- # Get all keys of user
- get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }
-
root to: "root#index"
- get '*unmatched_route', to: 'application#not_found'
+ # Since group show page is wildcard routing
+ # we want all other routing to be checked before matching this one
+ constraints(GroupUrlConstrainer.new) do
+ scope(path: '*id',
+ as: :group,
+ constraints: { id: Gitlab::Regex.namespace_route_regex, format: /(html|json|atom)/ },
+ controller: :groups) do
+ get '/', action: :show
+ patch '/', action: :update
+ put '/', action: :update
+ delete '/', action: :destroy
+ end
+ end
+
+ get '*unmatched_route', to: 'application#route_not_found'
end