Skip to content

Instantly share code, notes, and snippets.

@et
Last active February 6, 2018 07:03
Show Gist options
  • Save et/6d9347e7c2455de397905a46065ea715 to your computer and use it in GitHub Desktop.
Save et/6d9347e7c2455de397905a46065ea715 to your computer and use it in GitHub Desktop.
Set up initial handshake for Strava webhooks
require 'json'
require 'sinatra'
class App < Sinatra::Base
get '/event' do
hub_challenge = params['hub.challenge']
content_type :json
{ 'hub.challenge' => hub_challenge }.to_json
end
end
require 'sinatra'
require './app'
run App.new
source 'https://rubygems.org'
gem 'sinatra'
group :development do
gem 'sinatra-contrib'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment