aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
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 {