Skip to content

Instantly share code, notes, and snippets.

@remore
Created December 26, 2023 13:01
Show Gist options
  • Save remore/6eeb4d2bb83092f573cda66a207b6b99 to your computer and use it in GitHub Desktop.
Save remore/6eeb4d2bb83092f573cda66a207b6b99 to your computer and use it in GitHub Desktop.
require "compute_runtime"
req = ComputeRuntime::Request.new
resp = ComputeRuntime::Response.new
begin
req.method = "GET"
req.uri = "https://www.ruby-lang.org/en/"
result = req.send ComputeRuntime::Body.new.handle, "origin_0"
resp.send_downstream ComputeRuntime::Body.new(result[1])
rescue Exception => e
body.write "#{e}"
resp.send_downstream body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment