mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 11:48:09 +08:00
20 lines
323 B
Go
20 lines
323 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
s := &http.Server{
|
|
Addr: ":8199",
|
|
ReadTimeout: 2 * time.Second,
|
|
WriteTimeout: 2 * time.Second,
|
|
}
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Write([]byte("hi"))
|
|
time.Sleep(3 * time.Second)
|
|
})
|
|
s.ListenAndServe()
|
|
}
|