package handlers

import (
	"html/template"
	"log"
	"net/http"
)

var (
	templateLoop = template.Must(template.ParseFiles(
		"html/loop.html",
		"html/default.html",
	))
)

func DefaultHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Serving template for the default handler")
	if err := templateLoop.Execute(w, nil); err != nil {
		log.Println(err)
		http.Error(w, err.Error(), http.StatusInternalServerError)
	}
}
