package main import ( "gee" "net/http" ) func main() { //// 封装前 //obj := map[string]interface{}{} //obj["name"] = "dug" //obj["age"] = 18 //http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // w.Header().Set("Content-Type", "application/json") // w.WriteHeader(http.StatusOK) // encoder := json.NewEncoder(w) // if err := encoder.Encode(obj); err != nil { // http.Error(w, err.Error(), http.StatusInternalServerError) // } //}) //_ = http.ListenAndServe(":9000", nil) r := gee.New() r.GET("/", func(c *gee.Context) { c.Html(http.StatusOK, "