Golang http 服务器
package main
import (
"net/http"
"fmt"
)
func main() {
app := http.NewServeMux()
app.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w,fmt.Sprint("Method:",r.Method))
fmt.Fprintln(w,"Hello World")
})
http.ListenAndServe("127.0.0.1:8080", app)
}
转载请注明出处并保持作品的完整性,谢谢

浙公网安备 33010602011771号