Kemal Crystal
Kipande cha Crystal kwa Kemal kinachojibu maombi ya /pixel.gif kwa empty GIF, ambayo husimbuliwa (decode) mara moja programu inapoanza.
Kemal Crystal
require "base64"
require "kemal"
GIF = Base64.decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
get "/pixel.gif" do |env|
env.response.content_type = "image/gif"
env.response.headers["Cache-Control"] = "no-store"
env.response.write(GIF) # write the bytes; a non-String return value is ignored
nil
end
Kemal.run(8080)
Kimelinganishwa na nyaraka za sasa za framework.
Kagua
curl -sI http://localhost:8080/pixel.gif