Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 503 Bytes
require 'sinatra'
require 'json'
require 'ruby_spark'
require './env' if File.exists?('env.rb')
RubySpark.configuration do |config|
config.access_token = ENV['ACCESS_TOKEN']
config.timeout = 10000#.seconds # defaults to 30 seconds
end
core = RubySpark::Core.new("__YourCoreName__")
post '/' do
core.function("pushed", "foo")
push = JSON.parse(request.body.read)
return "I got some JSON: #{push.inspect}"
end
get '/' do
core.function("pushed", "foo")
return core.info.inspect
end