Sha256: 91f0cedb5312343fc0db6aa5c98dae129cd7667fe759576295ac68c7362a96b2
Contents?: true
Size: 608 Bytes
Versions: 12
Compression:
Stored size: 608 Bytes
Contents
module PactBroker class WebhookEndpointMiddleware def initialize app @app = app end def call(env) if env["PATH_INFO"] == "/pact-changed-webhook" body = env["rack.input"].read puts body PactBroker::VerificationJob.perform_in(2, JSON.parse(body, symbolize_names: true)) [200, {}, ["Pact changed webhook executed"]] elsif env["PATH_INFO"] == "/verification-published-webhook" body = env["rack.input"].read puts body [200, {}, ["Verification webhook executed"]] else @app.call(env) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems