A simple Go web server with logging, tracing, health check
Languages and libraries
web server reference
SHOW HN2018
Legend
A simple Go web server with logging, tracing, health check
A simple Go web server with logging, tracing, health check
gist.github.com#go web server#golang health check#golang middleware#graceful shutdown go
How HN took it
7 positive, 4 neutral or asking, 1 mixed, 4 critical, out of 16 comments about the project. Thread score +0.07.
Idea: 5 for, 4 againstDocs: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Useful reference showing best practices for Go servers
From 2 comments
Thanks for this. I have been writing toy golang servers for a while to try out various ideas and this really helps clarify some useful techniques and best practices.
AndrewStephens on HNIt's a nice reference program to show you what's going on. I build stuff like this for a living. I'd recommend not re-inventing the wheel yourself and using a nice web framework,…
oppositelock on HN
Impressive to do it in about a hundred lines using only the standard library
From 1 comment
To do all of this in just over a hundred lines of code without having to import packages to do it is pretty incredible. It may be just an exercise but it is a very cool one.
striking on HN
Objections
Standalone web server has little practical use; a reference, not a tool
From 2 comments
I do not quite see the point of this (other than being an exercise). We already have web server that do "logging, tracing, health check, graceful shutdown." I do not care about…
chrisper on HNSo a hundred lines of pure boilerplate hooking up Go standard libraries, assumedly exactly how they were intended to be used. How is this news worthy?
Ultimatt on HN
Standard-library-only approach is a poor reason to avoid dependencies for some
From 1 comment
> We should always try to strive to lower dependencies when it makes sense. Maybe, but I think 'when it makes sense', might be 'rarely'. There a 2 ways to avoid dependencies: 1.…
allover on HN
Requests
Add Let's Encrypt ACME certificate generation
From 2 comments
Can someone add letsencrypt.org ACME cert generation? https://godoc.org/golang.org/x/crypto/acme/autocert Edit: found this…
Xeoncross on HNNice. Does anyone have a server like this but with the addition of * serving of files and directories * LetsEncrypt certificates and SSL
skanga on HN
Add static file serving
From 1 comment
Nice. Does anyone have a server like this but with the addition of * serving of files and directories * LetsEncrypt certificates and SSL
skanga on HN
Questions
How is this different from Caddy, which is also written in Go?
From 1 comment
Isn't Caddy written in Go? How is this different?
coldcode on HN
Which Go web framework has a Django-like back-office scaffolding?
From 1 comment
This reminds me of an ongoing discussion I was having with friends about Golang web frameworks -- one side of the argument is that you can achieve so much with the standard…
rcarmo on HN
Alternatives named
Echo and Gin web frameworks
From 1 comment
It's a nice reference program to show you what's going on. I build stuff like this for a living. I'd recommend not re-inventing the wheel yourself and using a nice web framework,…
oppositelock on HN
Caddy
From 1 comment
Isn't Caddy written in Go? How is this different?
coldcode on HN
Finagle HTTP server for Java
From 1 comment
If you're using java, just use finagle's http server and be done with it. It is really good and runs most all of twitter.com's production web services. The very definition of…
SEJeff on HN
Jetty and Spring with Tomcat
From 1 comment
Jetty does everything, else Spring with tomcat. I don't see any reason to rely on JDK web server (which I've never seen anyone seriouosly use.
rb808 on HN