DEV Community

Cover image for code share: My Spontaneous HTTP-Server
Peter Hoffmann
Peter Hoffmann

Posted on

code share: My Spontaneous HTTP-Server

(Yes, I know, VSCode includes the wonderful Live Server)

Here is my gaffer tape and spray foam solution that allows you to start your HTTP server couch potato style:

Ingredients:

  • shell,
  • zenity
  • netstat
  • docker (trinitronx/python-simplehttpserver)
  • pwgen

Directions:

  1. ask for directory
  2. check for currently used ports
  3. randomly select a nice free port
  4. generate a unique container name
  5. serve your directory via a HTTP-server
  6. show link to address with option to close server

View the source

Top comments (0)