DEV Community

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

Posted on

1

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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay