Created
August 5, 2014 08:07
-
-
Save sudix/28e390243071469ea191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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