Re:Sherver: Bash lightweight web server
by nickjj on Wednesday December 22, 2021 @08:42AM
(#29649155)
That's my goto solution for a simple server if I'm testing something locally but it has issues dealing with concurrent requests in its simple form.
For example I ran a simple hello world test service on Kubernetes once using Python's http.server.
Just having 3 Kubernetes health checks happen on regular intervals would routinely cause the server to respond with errors. I think what ends up happening is if you have 2 requests coming in within a short enough period of time one of them will fail. You have to use a more complicated threaded http server if you want a zero dependency solution.
Re:Sherver: Bash lightweight web server
by rascul on Wednesday December 22, 2021 @08:18AM
(#29648899)
There are many similar options. I think that awhile ago there may have been a list of one liner web servers posted to HN. Either way, I've been using python's for years and it's just muscle memory now.
Personally, in that case, I'd use:
python3 -m http.server