initial import

This commit is contained in:
SourceFellows
2020-08-21 06:26:40 +02:00
commit e223458dd4
423 changed files with 9871 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"net/http"
"time"
)
func handleCall(res http.ResponseWriter, req *http.Request) {
ctx := req.Context()
select {
case <-ctx.Done():
res.Write([]byte("end"))
fmt.Println("clsoing connection to client")
return
case <-time.After(20 * time.Second):
fmt.Fprintln(res, "Hello World")
}
}
func main() {
http.HandleFunc("/", handleCall)
http.ListenAndServe(":8080", nil)
}