Created
December 26, 2023 13:01
-
-
Save remore/6eeb4d2bb83092f573cda66a207b6b99 to your computer and use it in GitHub Desktop.
a code snipet for https://rimuru.lunanet.gr.jp/notes/post/making-fastly-compute-even-more-helpful-with-unofficial-sdk
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 "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