require 'sinatra'
require 'cgi'
require 'json'
require 'pp'

get '/' do
  'This is a web hook!'
end

post '/' do
  pp JSON.parse(CGI.unescape(request.body.read.sub(/^payload=/, '')))
  'OK'
end

require 'sinatra'
require 'cgi'
require 'json'
require 'pp'

get '/' do
  'This is a web hook!'
end

post '/' do
  pp JSON.parse(params[:payload])
  'OK'
end

Use Sinatra's params rather than parsing ourselves
Use Sinatra's params rather than parsing ourselves
