Last active
November 22, 2018 21:44
-
-
Save bumi/24627ddd497889d0d9c74bad7fe7943e to your computer and use it in GitHub Desktop.
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
# initialize a client | |
client = Faraday.new(url: 'https://lightning-2pdf.herokuapp.com/') do |faraday| | |
faraday.use FaradayLnPaywall::Middleware, { max_amount: 100 } | |
faraday.adapter Faraday.default_adapter | |
end | |
# use the client to do API calls: | |
puts client.post("/convert/pdf", "# Hallo Welt").body |
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
Rack::Builder.new { | |
use Rack::Lightning, { price: 100 } | |
run Proc.new { |env| ['200', {'Content-Type' => 'text/html'}, ['get rack\'d']] } | |
}.to_app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment