Use template for faq page

This commit is contained in:
Lucas Schumacher 2024-07-31 21:18:51 -04:00
parent 8051f053c3
commit b3dbd23a8e

11
main.go
View File

@ -34,15 +34,8 @@ func contactHandler(w http.ResponseWriter, r *http.Request) {
executeTemplate(w, path) executeTemplate(w, path)
} }
func faqHandler(w http.ResponseWriter, r *http.Request) { func faqHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf8") path := "templates/faq.gohtml"
fmt.Fprint(w, ` executeTemplate(w, path)
<h1>FAQ</h1>
<hr>
<h3>Is this a real website?</h3>
<p>No.</p>
<h3>I Can Has Cheezburger?</h3>
<p>No.</p>
`)
} }
func notFoundHandler(w http.ResponseWriter, r *http.Request) { func notFoundHandler(w http.ResponseWriter, r *http.Request) {