emptygif
Basa: Basa Jawa

Kabeh basa lan framework

plumber R

Snippet R kanggo plumber sing mangsuli request menyang /pixel.gif nganggo empty GIF, sing didekode sepisan nalika startup.

plumber R

Instal
install.packages("plumber")
File
plumber.R
Lakokake
Rscript -e 'plumber::pr_run(plumber::pr("plumber.R"), port = 8080)'
# plumber.R
gif <- jsonlite::base64_dec("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")

#* @get /pixel.gif
#* @serializer contentType list(type = "image/gif")
function(res) {
  res$setHeader("Cache-Control", "no-store")
  gif
}

Snippet iki wis dilakokake lan byte asile wis dibandhingake.

Priksa

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

Situs resmi: plumber