diff calsync/main.go @ 55:627c815f83bb

wip- discovring that i need to rewrite the concurrency between watchers (1 per cal)
author drewp@bigasterisk.com
date Tue, 03 Sep 2024 14:50:20 -0700
parents 2991c1166852
children 635ff76f867c
line wrap: on
line diff
--- a/calsync/main.go	Tue Aug 20 12:18:46 2024 -0700
+++ b/calsync/main.go	Tue Sep 03 14:50:20 2024 -0700
@@ -1,6 +1,9 @@
 package main
 
 /*
+go build && ./gcalendarwatch
+
+
 let python continue to serve these:
 		Route('/', getRoot),
 		Route('/graph/calendar/upcoming', StaticGraph(agendaGraph)),
@@ -24,6 +27,9 @@
 )
 
 func main() {
+	_=http.StripPrefix
+	_=mux.NewRouter
+
 	ctx := context.Background()
 
 	log.SetFlags(log.LstdFlags | log.Lshortfile)
@@ -49,6 +55,7 @@
 		log.Fatal(err)
 	}
 
+	
 	/*
 		------------------
 		connect to mongodb with these ops:
@@ -70,18 +77,18 @@
 		    write add/edit/del changes to mongo
 	*/
 
-	r := mux.NewRouter()
-	http.Handle("/", r)
+	// r := mux.NewRouter()
+	// http.Handle("/", r)
 
-	home := func(w http.ResponseWriter, r *http.Request) {
-		w.Write([]byte("calsync service for calendar updates"))
-	}
-	r.HandleFunc("/", home)
-	r.HandleFunc("/gcalendarwatch", home)
+	// home := func(w http.ResponseWriter, r *http.Request) {
+	// 	w.Write([]byte("calsync service for calendar updates"))
+	// }
+	// r.HandleFunc("/", home)
+	// r.HandleFunc("/gcalendarwatch", home)
 
-	notificationHandler := func(w http.ResponseWriter, r *http.Request) {
-	}
-	r.HandleFunc("/gcalendarwatch/notification", notificationHandler).Methods("POST")
-	log.Println(("serving /gcalendarwatch/notification on :8080"))
-	log.Fatal(http.ListenAndServe(":8080", nil))
+	// notificationHandler := func(w http.ResponseWriter, r *http.Request) {
+	// }
+	// r.HandleFunc("/gcalendarwatch/notification", notificationHandler).Methods("POST")
+	// log.Println(("serving /gcalendarwatch/notification on :8080"))
+	// log.Fatal(http.ListenAndServe(":8080", nil))
 }