install grape and mount Gitlab::API
This commit is contained in:
parent
4c1f435ab7
commit
4aca61e8a6
4 changed files with 37 additions and 21 deletions
1
Gemfile
1
Gemfile
|
@ -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 "linguist", "~> 1.0.0", :git => "https://github.com/gitlabhq/linguist.git"
|
||||
|
||||
gem "grape"
|
||||
gem "stamp"
|
||||
gem "kaminari"
|
||||
gem "haml-rails"
|
||||
|
|
|
@ -162,6 +162,12 @@ GEM
|
|||
gherkin (2.11.0)
|
||||
json (>= 1.4.6)
|
||||
git (1.2.5)
|
||||
grape (0.2.0)
|
||||
hashie (~> 1.2)
|
||||
multi_json
|
||||
multi_xml
|
||||
rack
|
||||
rack-mount
|
||||
haml (3.1.6)
|
||||
haml-rails (0.3.4)
|
||||
actionpack (~> 3.0)
|
||||
|
@ -223,6 +229,8 @@ GEM
|
|||
rack (1.4.1)
|
||||
rack-cache (1.2)
|
||||
rack (>= 0.4)
|
||||
rack-mount (0.8.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-protection (1.2.0)
|
||||
rack
|
||||
rack-ssl (1.3.2)
|
||||
|
@ -373,6 +381,7 @@ DEPENDENCIES
|
|||
foreman
|
||||
git
|
||||
gitolite!
|
||||
grape
|
||||
grit!
|
||||
haml-rails
|
||||
httparty
|
||||
|
|
|
@ -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
|
||||
|
|
2
lib/api.rb
Normal file
2
lib/api.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class Gitlab::API < Grape::API
|
||||
end
|
Loading…
Reference in a new issue