【发布时间】:2014-11-24 23:01:56
【问题描述】:
我需要在“public”文件夹中设置默认页面“index.html”。我如何在 Martini 框架中做到这一点?
我试过了,但它不起作用:
func main() {
m := martini.Classic()
static := martini.Static("public", martini.StaticOptions{Fallback: "/index.html", Exclude: "/send"})
m.NotFound(static, http.NotFound)
m.Use(static)
m.Get("/send", sendEmail)
m.Run()
}
【问题讨论】: