Created
June 18, 2019 21:08
-
-
Save drincruz/c0d718b93466781a1b77f0e43576181c to your computer and use it in GitHub Desktop.
Quick Golang HTTP Server
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" | |
"time" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { | |
time.Sleep(5 * time.Second) | |
fmt.Fprintf(w, "{\"data\": \"p00t!\"}") | |
}) | |
http.ListenAndServe(":80", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment