mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop
This commit is contained in:
11
config/initializers/gitea_client.rb
Normal file
11
config/initializers/gitea_client.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'gitea-client'
|
||||
|
||||
config = Rails.application.config_for(:configuration).symbolize_keys!
|
||||
gitea_config = config[:gitea].symbolize_keys!
|
||||
|
||||
$gitea_client = Gitea::Api::Client.new({
|
||||
domain: gitea_config[:domain],
|
||||
base_url: gitea_config[:base_url],
|
||||
username: gitea_config[:username],
|
||||
password: gitea_config[:password]
|
||||
})
|
||||
@@ -1,5 +1,11 @@
|
||||
Rails.application.routes.draw do
|
||||
|
||||
def draw(routes_name)
|
||||
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
|
||||
end
|
||||
|
||||
draw :api
|
||||
|
||||
use_doorkeeper
|
||||
require 'sidekiq/web'
|
||||
require 'sidekiq/cron/web'
|
||||
|
||||
36
config/routes/api.rb
Normal file
36
config/routes/api.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
defaults format: :json do
|
||||
namespace :api do
|
||||
namespace :v1 do
|
||||
scope ':owner' do
|
||||
resource :users, path: '/', only: [:show, :update, :edit, :destroy]
|
||||
scope module: :users do
|
||||
resources :projects, only: [:index]
|
||||
end
|
||||
|
||||
scope ':repo' do
|
||||
# projects
|
||||
resource :projects, path: '/', only: [:show, :update, :edit, :destroy]
|
||||
|
||||
# projects文件夹下的
|
||||
scope module: :projects do
|
||||
resources :issues
|
||||
resources :pull_requests
|
||||
resources :versions
|
||||
resources :release_versions
|
||||
resources :webhooks do
|
||||
member do
|
||||
post :tests
|
||||
get :hooktasks
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
resources :projects, only: [:index]
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user