O'Reilly logo
  • Paul Kohler thinks this is interesting:

http.Handle("/images", http.FileServer(http.Dir("./images")))

From

Cover of Building Microservices with Go

Note

I needed to use http.StripPrefix and the pattern needs to end with a slash:

http.Handle("/images/", http.StripPrefix("/images/", http.FileServer(http.Dir("./images"))))