emptygif
ভাষা: বাংলা

সব ভাষা ও ফ্রেমওয়ার্ক

Roda Ruby

Roda-এর জন্য একটি Ruby স্নিপেট, যা /pixel.gif-এ আসা রিকোয়েস্টের উত্তরে empty GIF পাঠায়। GIF-টি স্টার্টআপে একবারই ডিকোড হয়।

Roda Ruby

ইনস্টল
gem install roda rackup puma
ফাইল
config.ru
চালান
rackup -p 8080
require "roda"

class App < Roda
  GIF = "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==".unpack1("m0").freeze

  route do |r|
    # Roda string matchers are written without the leading slash.
    r.get "/pixel.gif".delete_prefix("/") do
      response["content-type"] = "image/gif"
      response["cache-control"] = "no-store"
      GIF
    end
  end
end

run App.freeze.app

আমরা এই স্নিপেট চালিয়েছি এবং এটি যে বাইটগুলো ফেরত দিয়েছে তা মিলিয়ে দেখেছি।

যাচাই করুন

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

অফিশিয়াল সাইট: Roda

Ruby-এ আরও