Skip to content

Instantly share code, notes, and snippets.

@ihucos
Created June 5, 2020 07:46
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 ihucos/82199ac4adc218c0cf96ca75b404f9f5 to your computer and use it in GitHub Desktop.
Save ihucos/82199ac4adc218c0cf96ca75b404f9f5 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
)
func hello(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "hello world\n")
}
func main() {
http.HandleFunc("/hello", hello)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment