Skip to content

Instantly share code, notes, and snippets.

@sudix
Created August 5, 2014 08:07
Show Gist options
  • Save sudix/28e390243071469ea191 to your computer and use it in GitHub Desktop.
Save sudix/28e390243071469ea191 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
)
func DefaultHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, HTTP!!!")
}
func SeeYouHandler(w http.ResponseWriter, r *http.Request) {
name := r.FormValue("name")
fmt.Fprintf(w, "See you, %s!!!", name)
}
func main() {
http.HandleFunc("/", DefaultHandler)
http.HandleFunc("/seeyou", SeeYouHandler)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment