Skip to content

Instantly share code, notes, and snippets.

@avelino
Created February 14, 2017 12:51
Show Gist options
  • Save avelino/7dc3a66ce210a717a0ec835f3609d6bd to your computer and use it in GitHub Desktop.
Save avelino/7dc3a66ce210a717a0ec835f3609d6bd to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", viewHandler)
http.ListenAndServe(":8080", nil)
}
func viewHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-type", "text/plain")
fmt.Fprintf(w, "Hello World")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment