Skip to content

Instantly share code, notes, and snippets.

@shunirr

shunirr/app.rb

Created Apr 8, 2016
Embed
What would you like to do?
LINE Bot API Proxy
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