summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-06-27 02:26:16 -0700
committerNihad Abbasov <narkoz.2008@gmail.com>2012-06-28 03:42:58 -0700
commit4aca61e8a60cae56a7cceec7d66fd7aa4138c274 (patch)
treea1bd11586f82eb3813bd847ce6aa8115afcdb093 /config
parent4c1f435ab78e5d4da3d6aaaf20579be13b662d02 (diff)
downloadgitlab-ce-4aca61e8a60cae56a7cceec7d66fd7aa4138c274.tar.gz
install grape and mount Gitlab::API
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb46
1 files changed, 25 insertions, 21 deletions
diff --git a/config/routes.rb b/config/routes.rb
index d1dd03ab985..35133d03ca7 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -4,6 +4,10 @@ Gitlab::Application.routes.draw do
#
get 'search' => "search#show"
+ # API
+ require 'api'
+ mount Gitlab::API => '/api'
+
# Optionally, enable Resque here
require 'resque/server'
mount Resque::Server.new, at: '/info/resque'
@@ -20,15 +24,15 @@ Gitlab::Application.routes.draw do
# Admin Area
#
namespace :admin do
- resources :users do
- member do
+ resources :users do
+ member do
put :team_update
put :block
put :unblock
end
end
- resources :projects, :constraints => { :id => /[^\/]+/ } do
- member do
+ resources :projects, :constraints => { :id => /[^\/]+/ } do
+ member do
get :team
put :team_update
end
@@ -79,12 +83,12 @@ Gitlab::Application.routes.draw do
resources :wikis, :only => [:show, :edit, :destroy, :create] do
member do
- get "history"
+ get "history"
end
end
- resource :repository do
- member do
+ resource :repository do
+ member do
get "branches"
get "tags"
get "archive"
@@ -94,14 +98,14 @@ Gitlab::Application.routes.draw do
resources :deploy_keys
resources :protected_branches, :only => [:index, :create, :destroy]
- resources :refs, :only => [], :path => "/" do
- collection do
+ resources :refs, :only => [], :path => "/" do
+ collection do
get "switch"
end
- member do
+ member do
get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
- get "blob",
+ get "blob",
:constraints => {
:id => /[a-zA-Z.0-9\/_\-]+/,
:path => /.*/
@@ -126,32 +130,32 @@ Gitlab::Application.routes.draw do
end
end
- resources :merge_requests do
- member do
+ resources :merge_requests do
+ member do
get :diffs
get :automerge
get :automerge_check
end
- collection do
+ collection do
get :branch_from
get :branch_to
end
end
-
- resources :snippets do
- member do
+
+ resources :snippets do
+ member do
get "raw"
end
end
- resources :hooks, :only => [:index, :create, :destroy] do
- member do
+ resources :hooks, :only => [:index, :create, :destroy] do
+ member do
get :test
end
end
- resources :commits do
- collection do
+ resources :commits do
+ collection do
get :compare
end
end