Commit 4aca61e8 authored by Nihad Abbasov's avatar Nihad Abbasov

install grape and mount Gitlab::API

parent 4c1f435a
...@@ -17,6 +17,7 @@ gem "omniauth-ldap", :git => "https://github.com/gitlabhq/omniauth-ldap.git", ...@@ -17,6 +17,7 @@ gem "omniauth-ldap", :git => "https://github.com/gitlabhq/omniauth-ldap.git",
gem 'yaml_db', :git => "https://github.com/gitlabhq/yaml_db.git" gem 'yaml_db', :git => "https://github.com/gitlabhq/yaml_db.git"
gem "linguist", "~> 1.0.0", :git => "https://github.com/gitlabhq/linguist.git" gem "linguist", "~> 1.0.0", :git => "https://github.com/gitlabhq/linguist.git"
gem "grape"
gem "stamp" gem "stamp"
gem "kaminari" gem "kaminari"
gem "haml-rails" gem "haml-rails"
......
...@@ -162,6 +162,12 @@ GEM ...@@ -162,6 +162,12 @@ GEM
gherkin (2.11.0) gherkin (2.11.0)
json (>= 1.4.6) json (>= 1.4.6)
git (1.2.5) git (1.2.5)
grape (0.2.0)
hashie (~> 1.2)
multi_json
multi_xml
rack
rack-mount
haml (3.1.6) haml (3.1.6)
haml-rails (0.3.4) haml-rails (0.3.4)
actionpack (~> 3.0) actionpack (~> 3.0)
...@@ -223,6 +229,8 @@ GEM ...@@ -223,6 +229,8 @@ GEM
rack (1.4.1) rack (1.4.1)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-protection (1.2.0) rack-protection (1.2.0)
rack rack
rack-ssl (1.3.2) rack-ssl (1.3.2)
...@@ -373,6 +381,7 @@ DEPENDENCIES ...@@ -373,6 +381,7 @@ DEPENDENCIES
foreman foreman
git git
gitolite! gitolite!
grape
grit! grit!
haml-rails haml-rails
httparty httparty
......
...@@ -4,6 +4,10 @@ Gitlab::Application.routes.draw do ...@@ -4,6 +4,10 @@ Gitlab::Application.routes.draw do
# #
get 'search' => "search#show" get 'search' => "search#show"
# API
require 'api'
mount Gitlab::API => '/api'
# Optionally, enable Resque here # Optionally, enable Resque here
require 'resque/server' require 'resque/server'
mount Resque::Server.new, at: '/info/resque' mount Resque::Server.new, at: '/info/resque'
...@@ -20,15 +24,15 @@ Gitlab::Application.routes.draw do ...@@ -20,15 +24,15 @@ Gitlab::Application.routes.draw do
# Admin Area # Admin Area
# #
namespace :admin do namespace :admin do
resources :users do resources :users do
member do member do
put :team_update put :team_update
put :block put :block
put :unblock put :unblock
end end
end end
resources :projects, :constraints => { :id => /[^\/]+/ } do resources :projects, :constraints => { :id => /[^\/]+/ } do
member do member do
get :team get :team
put :team_update put :team_update
end end
...@@ -79,12 +83,12 @@ Gitlab::Application.routes.draw do ...@@ -79,12 +83,12 @@ Gitlab::Application.routes.draw do
resources :wikis, :only => [:show, :edit, :destroy, :create] do resources :wikis, :only => [:show, :edit, :destroy, :create] do
member do member do
get "history" get "history"
end end
end end
resource :repository do resource :repository do
member do member do
get "branches" get "branches"
get "tags" get "tags"
get "archive" get "archive"
...@@ -94,14 +98,14 @@ Gitlab::Application.routes.draw do ...@@ -94,14 +98,14 @@ Gitlab::Application.routes.draw do
resources :deploy_keys resources :deploy_keys
resources :protected_branches, :only => [:index, :create, :destroy] resources :protected_branches, :only => [:index, :create, :destroy]
resources :refs, :only => [], :path => "/" do resources :refs, :only => [], :path => "/" do
collection do collection do
get "switch" get "switch"
end end
member do member do
get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ } get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
get "blob", get "blob",
:constraints => { :constraints => {
:id => /[a-zA-Z.0-9\/_\-]+/, :id => /[a-zA-Z.0-9\/_\-]+/,
:path => /.*/ :path => /.*/
...@@ -126,32 +130,32 @@ Gitlab::Application.routes.draw do ...@@ -126,32 +130,32 @@ Gitlab::Application.routes.draw do
end end
end end
resources :merge_requests do resources :merge_requests do
member do member do
get :diffs get :diffs
get :automerge get :automerge
get :automerge_check get :automerge_check
end end
collection do collection do
get :branch_from get :branch_from
get :branch_to get :branch_to
end end
end end
resources :snippets do resources :snippets do
member do member do
get "raw" get "raw"
end end
end end
resources :hooks, :only => [:index, :create, :destroy] do resources :hooks, :only => [:index, :create, :destroy] do
member do member do
get :test get :test
end end
end end
resources :commits do resources :commits do
collection do collection do
get :compare get :compare
end end
end end
......
class Gitlab::API < Grape::API
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment