You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
414 B

package Webserver
import (
"net/http"
"PersonalWebsite/Database"
)
func ViewIndex(w http.ResponseWriter, r *http.Request) {
var (
v = make(map[string]interface{})
e error
)
v["PageView"] = "index-intro.gohtml"
v["Posts"], e = Database.GetPostsList(5, 0)
if e != nil {
// TODO: Handle this
http.Error(w, "Error", http.StatusInternalServerError)
}
ServeTemplate(w, r, "html/index.gohtml", v)
}