Skip to content

Instantly share code, notes, and snippets.

@just1689
Created September 13, 2019 05:49
Show Gist options
  • Select an option

  • Save just1689/1622360975a0d18a76b0a50e52d43b9e to your computer and use it in GitHub Desktop.

Select an option

Save just1689/1622360975a0d18a76b0a50e52d43b9e to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"os"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w,r, r.URL.RequestURI()[1:])
})
panic(http.ListenAndServe(os.Getenv("listenAddr"), nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment