Skip to content

Instantly share code, notes, and snippets.

@bumi
Last active November 22, 2018 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bumi/24627ddd497889d0d9c74bad7fe7943e to your computer and use it in GitHub Desktop.
Save bumi/24627ddd497889d0d9c74bad7fe7943e to your computer and use it in GitHub Desktop.
# 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
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