Skip to content

Instantly share code, notes, and snippets.

@vishvish
Created December 3, 2015 00:34
Show Gist options
  • Save vishvish/f67f50ee73bffa14d869 to your computer and use it in GitHub Desktop.
Save vishvish/f67f50ee73bffa14d869 to your computer and use it in GitHub Desktop.
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