summaryrefslogtreecommitdiffstats
path: root/router/not_found_handler.go
blob: b757138a943509cf188d568a70482d851ae17b5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package router

import (
	"net/http"
)

func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusNotFound)

	nftv := NotFoundTemplateVariables{NewCommonVariables(r)}

	err := notFoundTemplate.ExecuteTemplate(w, "index.html", nftv)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
	}
}