Valentin Brandl
12fbb06666
All checks were successful
golangci-lint / lint (push) Successful in 19m8s
23 lines
439 B
Go
23 lines
439 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/rs/zerolog/hlog"
|
|
)
|
|
|
|
func (app *Application) Index(w http.ResponseWriter, r *http.Request) {
|
|
l := hlog.FromRequest(r)
|
|
l.Info().Msg("Index")
|
|
|
|
reqId := RequestID(r)
|
|
|
|
err := indexTemplate.Execute(w, templateData{
|
|
RequestID: reqId,
|
|
})
|
|
if err != nil {
|
|
l.Error().Err(err).Msg("error executing template")
|
|
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
|
}
|
|
}
|