Web Server

We use the http package in Go a lot. so this group of pages is written to explore the possibilities.

Expected outline

  • Simple web server serving the current directories pages. Almost a one liner.
  • Hello world! Show calling go code for a web page contenthttps://pkg.go.dev/net/http#hdr-Patterns.
  • Explore the new patterns for the handlers. Since 1.22 (maybe 1.21?) the patterns are greatly enhanced so we might want to try creating different patterns. Doc at
  • Hello George. (broken) Show handling a form value. And show the problem of echoing user input.
  • Hello George 2. Use http templates to quote user code for safety.
  • TLS. It isn’t as hard to use a certificate as it is to procure one.
  • TLS safer. Remove old cyphers to make the server safer (and get by Infosec).

Someday Maybe

The articles above ignores any code in the browser. If you are writing apps you might want fancier features like websockets, graphql, logins etc. Maybe I could explore these ideas further.