at main 671 B view raw
1package main 2 3import ( 4 "log" 5 "net/http" 6) 7 8func handleIndex(w http.ResponseWriter, r *http.Request) { 9 log.Printf("DEBUG: handleIndex called - Method: %s, URL: %s", r.Method, r.URL.Path) 10 session, _ := store.Get(r, sessionName) 11 if session.Values["did"] == nil { 12 http.Redirect(w, r, "/signin", http.StatusFound) 13 return 14 } 15 http.Redirect(w, r, "/timeline", http.StatusFound) 16} 17 18func handleSignin(w http.ResponseWriter, r *http.Request) { 19 executeTemplate(w, "signin.html", nil) 20} 21 22func handleAbout(w http.ResponseWriter, r *http.Request) { 23 log.Printf("DEBUG: handleAbout called - Method: %s, URL: %s", r.Method, r.URL.Path) 24 executeTemplate(w, "about.html", nil) 25}