package handlecontroller import ( "main_exam_server/controller" "net/http" "github.com/unrolled/render" ) //首页数据处理 func GetIndexPage() http.HandlerFunc { return func(rw http.ResponseWriter, rep *http.Request) { formatter := render.New(render.Options{IndentJSON: true}) formatter.JSON(rw, http.StatusOK, controller.Index(rep)) } }