A simple Go web server with logging, tracing, health check

Languages and libraries

web server reference

SHOW HN2018

318points
91comments
#75of 2,155 in 2018
Top 4%of 2018 by points

How HN took it

DebatedReal support and real criticism

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 HN
    • 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
  • 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 HN
    • So 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 HN
    • 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
  • 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
  • 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
  • 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

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/16090977)