Created
April 8, 2016 03:30
-
-
Save shunirr/2a2c9a3403893ebabbe23114db4fd345 to your computer and use it in GitHub Desktop.
LINE Bot API Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'httpclient' | |
CALLBACK_URI = URI.parse('http://example.com/callback') | |
configure do | |
set :httpclient, HTTPClient.new | |
end | |
post '/callback' do | |
settings.httpclient.post_async( | |
CALLBACK_URI, | |
request.body.read, | |
{ | |
'Content-Type' => 'application/json; charset=UTF-8', | |
'X-LINE-ChannelSignature' => request.env['X-LINE-ChannelSignature'] | |
}) | |
200 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment