21 lines
492 B
Go
21 lines
492 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"text/template"
|
|
|
|
"git.espin.casa/albert/cml04-falcon-ui/storage"
|
|
"github.com/julienschmidt/httprouter"
|
|
)
|
|
|
|
func IndexHandler(storage storage.Storager) httprouter.Handle {
|
|
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
t, _ := template.ParseFiles("templates/base.html", "templates/index.html")
|
|
err := t.Execute(w, nil)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
}
|
|
}
|