Skip to content

Instantly share code, notes, and snippets.

@yvasiyarov
Created May 11, 2014 08:51
Show Gist options
  • Save yvasiyarov/8ba8dde41807b4b72cd9 to your computer and use it in GitHub Desktop.
Save yvasiyarov/8ba8dde41807b4b72cd9 to your computer and use it in GitHub Desktop.
Hello world - plain net/http
package main
import (
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello world"))
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment