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

  1. package Webserver
  2. import (
  3. "net/http"
  4. "PersonalWebsite/Database"
  5. )
  6. func ViewIndex(w http.ResponseWriter, r *http.Request) {
  7. var (
  8. v = make(map[string]interface{})
  9. e error
  10. )
  11. v["PageView"] = "index-intro.gohtml"
  12. v["Posts"], e = Database.GetPostsList(5, 0)
  13. if e != nil {
  14. // TODO: Handle this
  15. http.Error(w, "Error", http.StatusInternalServerError)
  16. }
  17. ServeTemplate(w, r, "html/index.gohtml", v)
  18. }