package main
import "fmt"
import "net/http"
func HttpHelloGo(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "Hello,"+req.URL.Path[1:])
}
func main() {
fmt.Println("开始启动http服务器")
http.HandleFunc("/hellogo", HttpHelloGo)
http.ListenAndServe(":8081", nil)
}
网友评论