From 3fe43f85aefedc6223aee45171df483e2f57c381 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 9 Feb 2020 16:19:55 +0100 Subject: Integrate Bootstrap CSS --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index ee01c6e..ddd6552 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "os" "strings" "flag" - "fmt" "log" "net/http" "io/ioutil" @@ -156,6 +155,7 @@ type LoginFormData struct { var ( templateLogin = template.Must(template.ParseFiles("templates/layout.html", "templates/login.html")) + templateHome = template.Must(template.ParseFiles("templates/layout.html", "templates/home.html")) ) // Page handlers ---- @@ -166,7 +166,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) { return } - fmt.Fprintf(w, "Welcome, %s!", login.Username) + templateHome.Execute(w, login) } func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo { -- cgit v1.2.3