예제 #1
0
파일: list.go 프로젝트: keimoon/voicewiki
func List(w http.ResponseWriter, r *http.Request) {
	data := make(middleware.Data)
	articles, err := article.List()
	if err != nil {
		middleware.Fatal(w)
		return
	}
	data["Title"] = "Recent articles"
	data["Articles"] = articles
	middleware.RenderView(w, "list.html", data)
}
예제 #2
0
func ListArticle(w http.ResponseWriter, r *http.Request) {
	articles, _ := article.List()
	middleware.RenderJSON(w, articles)
}