2015-09-24 01:44:49 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2015-09-24 02:08:44 -04:00
|
|
|
"github.com/flosch/pongo2"
|
2015-09-24 01:44:49 -04: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"))
|
|
|
|
|
2015-09-24 23:21:37 -04:00
|
|
|
err := indexTpl.ExecuteWriter(pongo2.Context{}, w)
|
2015-09-24 01:44:49 -04:00
|
|
|
if err != nil {
|
|
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
|
|
}
|
|
|
|
}
|