Tag: explained

  • One-liner for serving static files in Go explained

    Whenever I want to set up a server for serving static files in Go, which is not often, I always have to spend some time to figure out the following one-liner. http.Handle(“/images/”, http.StripPrefix(“/images/”, http.FileServer(http.Dir(“./images”)))) What confuses me probably the most here is all three strings being practically the same. So in this post I will…