diff --git a/client/rsvps_list.html b/client/rsvps_list.html
new file mode 100644
index 0000000..c1c0791
--- /dev/null
+++ b/client/rsvps_list.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Collin and Lucy's Wedding
+
+
+
+
+
\ No newline at end of file
diff --git a/client/rsvps_list.js b/client/rsvps_list.js
new file mode 100644
index 0000000..93aeae6
--- /dev/null
+++ b/client/rsvps_list.js
@@ -0,0 +1,13 @@
+function createRsvpEntry(rsvp) {
+
+}
+
+async function getRsvps() {
+ // token is test:test for now
+ const resp = await fetch('/api/rsvps', { headers: { 'Authorization': 'Basic dGVzdDp0ZXN0'} })
+ JSON.parse(resp.body)
+}
+
+window.onload = async function () {
+ await getRsvps();
+};
\ No newline at end of file
diff --git a/controller.go b/controller.go
index eb6efac..d28fd7a 100644
--- a/controller.go
+++ b/controller.go
@@ -70,7 +70,7 @@ func isAuthorized(r *http.Request) bool {
return false
}
- return auth == token
+ return auth == fmt.Sprintf("Basic %s", token)
}
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@@ -86,12 +86,18 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case r.Method == "GET" && r.URL.Path == "/rsvp_confirmed":
getStaticFile("./client/rsvp_confirmed.html", "text/html", w)
+ case r.Method == "GET" && r.URL.Path == "/rsvps_list":
+ getStaticFile("./client/rsvps_list.html", "text/html", w)
+
case r.Method == "GET" && r.URL.Path == "/index.js":
getStaticFile("./client/index.js", "text/javascript", w)
case r.Method == "GET" && r.URL.Path == "/rsvp.js":
getStaticFile("./client/rsvp.js", "text/javascript", w)
+ case r.Method == "GET" && r.URL.Path == "/rsvps_list.js":
+ getStaticFile("./client/rsvps_list.js", "text/javascript", w)
+
case r.Method == "GET" && r.URL.Path == "/style.css":
getStaticFile("./client/style.css", "text/css", w)
@@ -121,7 +127,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
attending := r.Form.Get("attending") == "true"
- partySize, err := strconv.ParseInt(r.Form.Get("party-size"), 10, 1)
+ partySize, err := strconv.ParseInt(r.Form.Get("party-size"), 10, 64)
if err != nil {
fmt.Println(err)