Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package home
- import (
- "html/template"
- "log"
- "net/http"
- "scarga/app/models/claims"
- )
- func Controller(w http.ResponseWriter, r *http.Request) {
- cl, err := claims.GetAll()
- if err != nil {
- log.Println(err)
- http.Error(w, err.Error(), 500)
- return
- }
- t, err := template.ParseFiles("./resources/views/index.html")
- if err != nil {
- http.Error(w, err.Error(), 500)
- return
- }
- err = t.ExecuteTemplate(w, "index", cl)
- if err != nil {
- log.Println(err)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement