Created
January 9, 2020 12:26
-
-
Save hayunjong83/4cba254b79ea645c66e7a9d5b62a9700 to your computer and use it in GitHub Desktop.
hello world go web application
This file contains hidden or 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 ( | |
"fmt" | |
"net/http" | |
) | |
func handler(writer http.ResponseWriter, request *http.Request) { | |
fmt.Fprintf(writer, "Hello Go World, %s!", request.URL.Path[1:]) | |
} | |
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