Skip to content

Instantly share code, notes, and snippets.

@acoshift
Created July 15, 2021 14:51
Show Gist options
  • Save acoshift/8368a6844e401ad0e587ffcf0ffa35c8 to your computer and use it in GitHub Desktop.
Save acoshift/8368a6844e401ad0e587ffcf0ffa35c8 to your computer and use it in GitHub Desktop.
Hello World Handler with sleep
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