18 lines
281 B
Go
18 lines
281 B
Go
package httpserver
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
var tmp *template.Template
|
|
|
|
func templateInit() {
|
|
tmp, _ = template.ParseGlob("web/templates/*")
|
|
}
|
|
|
|
func notFound(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(404)
|
|
tmp.ExecuteTemplate(w, "404.html", nil)
|
|
}
|