aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-09 16:19:55 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-09 16:19:55 +0100
commit3fe43f85aefedc6223aee45171df483e2f57c381 (patch)
tree19e4fbb9e7708db40f238218d9bc961fcca3a1c9 /main.go
parente72034c430eb8e78a87d4b1d312e4a9c11f3df14 (diff)
downloadguichet-3fe43f85aefedc6223aee45171df483e2f57c381.tar.gz
guichet-3fe43f85aefedc6223aee45171df483e2f57c381.zip
Integrate Bootstrap CSS
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 {