12345678910111213141516
  1. package main
  2. import (
  3. "io/ioutil"
  4. "net/http"
  5. )
  6. func helpHandler(w http.ResponseWriter, r *http.Request) {
  7. content, err := ioutil.ReadFile("./help.html")
  8. if err != nil {
  9. http.Error(w, err.Error(), http.StatusInternalServerError)
  10. }
  11. w.Header().Set("Content-Type", "text/html; charset=utf-8")
  12. w.Write(content)
  13. }