News for hackers. Stuff that matters.
Re:Sherver: Bash lightweight web server by BossingAround on Wednesday December 22, 2021 @08:14AM (#29648859)
> I didn't want to install and configure Apache or nGinx. In fact, I didn't want any configuration.

Personally, in that case, I'd use:

python3 -m http.server

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.
Re:Sherver: Bash lightweight web server by em500 on Wednesday December 22, 2021 @08:21AM (#29648952)
Big list of http static servers:

https://gist.github.com/willurd/5720255

Re:Sherver: Bash lightweight web server by adamddev1 on Wednesday December 22, 2021 @01:58PM (#29653537)
`npm install -g live-server`

Also works great (but a bit bulkier sure).