Skip to content

Instantly share code, notes, and snippets.

@pei0804
Created July 5, 2019 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pei0804/a2f6aac4a4da47d223b98dfc9993ec7d to your computer and use it in GitHub Desktop.
Save pei0804/a2f6aac4a4da47d223b98dfc9993ec7d to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"net/http"
)
type simpleHandler struct{}
func (h *simpleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "hello")
}
func main() {
http.Handle("/count", new(simpleHandler))
log.Fatal(http.ListenAndServe(":8080", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment