Public Repository

Last pushed: a year ago
Short Description
Single Line Web Server for Raspberry Pi / Raspi
Full Description

Single Line Web Server for Raspi

  • super small microservice that is implemented as a single line web server
  • the clever server returns its own hostname and a version number (which is set to 1)
  • the server consists of two files
    • the server itself:

      while true; do { printf 'HTTP/1.1 200 OK\r\n\r\n'; sh response.template; } | nc -l -v -p 8888; done

    • a file response.template for the reply.

      printf "{ hostname: $(hostname) , version: 1 } \n"

what is it good for?

Try load balancing over this container and you should see different host names.
Also try rolling updates with a different version number in response template!

Feel free to use and modify this little example but reference this site. @frankmunz

Docker Pull Command