Skip to content

Instantly share code, notes, and snippets.

@malclocke
Created August 26, 2025 02:17
Show Gist options
  • Save malclocke/9dc021e12d82887ac901210d74e6ea7d to your computer and use it in GitHub Desktop.
Save malclocke/9dc021e12d82887ac901210d74e6ea7d to your computer and use it in GitHub Desktop.
Ruby JSON webhook echo server
# frozen_string_literal: true
# Run with 'bundle exec rackup'
require "json"
require "pry"
run do |env|
request = Rack::Request.new(env)
Pry::ColorPrinter.pp(JSON.parse(request.body.read))
[200, {}, request.body]
end
# frozen_string_literal: true
source "https://rubygems.org"
gem "rack"
gem "pry"
gem "rackup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment