0
"public"폴더에있는 기본 페이지 "index.html"을 설정해야합니다. 어떻게 마티니 프레임 워크에서이 작업을 수행 할 수 있습니까? Martini에서 기본 정적 페이지를 설정하는 방법은 무엇입니까?
나는이 tryed,하지만 작동하지 않습니다 당신은 제대로하고있는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()
}
나는 씹었습니다. 색인, HTML이 공용 폴더에 있습니다. Screenshot : https://yadi.sk/i/5r0_k_UTcv5WW – Pavel
어떻게 앱을 실행하고 어떤 오류가 발생합니까? 내 코드 (index.html에는 "Hello, World"가 포함되어 있습니다) : http://imgur.com/2aI0TMO – divan