Ruby on rails 如何配置Pipedream来测试rails中的Webhook?
首先,第一次使用Ruby on rails 如何配置Pipedream来测试rails中的Webhook?,ruby-on-rails,ngrok,pipedream,Ruby On Rails,Ngrok,Pipedream,首先,第一次使用Webhook。我正试图在我的开发服务器上测试它。为此,我正在尝试使用PipeDream配置它,并且还安装了ngrok。但问题是如何在我的控制器中为Pipedream配置端点,因为我将被重定向到rails欢迎页面 服务类别: class DummyService include HTTParty format :json base_uri 'https://en5q.m.pipedream.net' def initialize; end def sel
Webhook
。我正试图在我的开发服务器上测试它。为此,我正在尝试使用PipeDream
配置它,并且还安装了ngrok
。但问题是如何在我的控制器中为Pipedream
配置端点,因为我将被重定向到rails欢迎页面
服务类别:
class DummyService
include HTTParty
format :json
base_uri 'https://en5q.m.pipedream.net'
def initialize; end
def self.getData
get("", timeout: TKlass::TIMEOUT)
end
end
def index
dummyService = DummyService.getData
json = JSON.parse(dummyService.body.gsub("@attributes","attributes"))
json["dummyService_enabled"] = Setting.dummyService_enabled
if json.blank?
record_not_found
else
render json: json
end
end
def push
# kind = params[:push_type]
# body = params[:push_body]
byebug
end
控制器:
class DummyService
include HTTParty
format :json
base_uri 'https://en5q.m.pipedream.net'
def initialize; end
def self.getData
get("", timeout: TKlass::TIMEOUT)
end
end
def index
dummyService = DummyService.getData
json = JSON.parse(dummyService.body.gsub("@attributes","attributes"))
json["dummyService_enabled"] = Setting.dummyService_enabled
if json.blank?
record_not_found
else
render json: json
end
end
def push
# kind = params[:push_type]
# body = params[:push_body]
byebug
end
路线:
resources :webhooktester, only: [ :index ] do
collection do
get :push
end
end
我错过了什么