Created
May 11, 2014 08:51
-
-
Save yvasiyarov/8ba8dde41807b4b72cd9 to your computer and use it in GitHub Desktop.
Hello world - plain net/http
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 ( | |
"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