emptygif
Basa: Basa Jawa

Kabeh basa lan framework

Oxygen.jl Julia

Snippet Julia kanggo Oxygen.jl sing mangsuli request menyang /pixel.gif nganggo empty GIF, sing didekode sepisan nalika startup.

Oxygen.jl Julia

Instal
julia -e 'using Pkg; Pkg.add(["Oxygen", "HTTP"])'
File
server.jl
Lakokake
julia server.jl
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)

Snippet iki wis dilakokake lan byte asile wis dibandhingake.

Priksa

curl -sI http://localhost:8080/pixel.gif

Situs resmi: Oxygen.jl

Liyane ing Julia