ProfouzorsLinx/pages.go

18 lines
369 B
Go
Raw Normal View History

2015-09-24 07:44:49 +02:00
package main
import (
"net/http"
2015-09-24 08:08:44 +02:00
"github.com/flosch/pongo2"
2015-09-24 07:44:49 +02:00
"github.com/zenazn/goji/web"
)
func indexHandler(c web.C, w http.ResponseWriter, r *http.Request) {
indexTpl := pongo2.Must(pongo2.FromCache("templates/index.html"))
err := indexTpl.ExecuteWriter(pongo2.Context{}, w)
2015-09-24 07:44:49 +02:00
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}