Last active
August 27, 2020 13:19
-
-
Save mchirico/233379462bf2b561a180b58b925dd37e to your computer and use it in GitHub Desktop.
Simple Go Web Server
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 ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
log.Println("starting server...") | |
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte(`Hello world`)) | |
}) | |
log.Fatal(http.ListenAndServe(":8080", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment