Created
December 3, 2015 00:34
-
-
Save vishvish/f67f50ee73bffa14d869 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" | |
"os" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
h, _ := os.Hostname() | |
fmt.Fprintf(w, "Hi there, I'm served from %s!", h) | |
} | |
func main() { | |
http.HandleFunc("/", handler) | |
http.ListenAndServe(":8484", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment