Oxygen.jl Julia
Snippet na Julia don Oxygen.jl da ke amsa requests zuwa /pixel.gif da empty GIF, wanda ake decoding ɗinsa sau ɗaya lokacin farawa.
Oxygen.jl Julia
using Base64
using HTTP
using Oxygen
const GIF = base64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
@get "/pixel.gif" function (req::HTTP.Request)
HTTP.Response(200, ["Content-Type" => "image/gif", "Cache-Control" => "no-store"], GIF)
end
serve(host = "0.0.0.0", port = 8080)
Mun gudanar da wannan snippet kuma mun kwatanta bytes ɗin da ya mayar.
Duba shi
curl -sI http://localhost:8080/pixel.gif