Created
July 15, 2021 14:51
-
-
Save acoshift/8368a6844e401ad0e587ffcf0ffa35c8 to your computer and use it in GitHub Desktop.
Hello World Handler with sleep
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" | |
"time" | |
) | |
func main() { | |
http.ListenAndServe(":3000", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
time.Sleep(200 * time.Millisecond) | |
w.Write([]byte("Hello World")) | |
})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment