jjzjj

http - 使用 FileServer 从 RiceBox 提供 favicon.icon

我一直在努力解决这个问题。如何从RiceBox返回静态目录中的favicon.ico?这是我的代码,包括相关部分:mux:=mux.NewServeMux()StaticBox:=rice.MustFindBox("static")StaticFileServer:=http.StripPrefix("/static/",http.FileServer(StaticBox.HTTPBox()))mux.Handle("/static/",StaticFileServer)mux.HandleFunc("/",Home)注意:favicon.ico与其他Assets(如js/、css/等