diff --git a/go-web-app/gowiki/cmd/gowiki/main.go b/go-web-app/gowiki/cmd/gowiki/main.go index b70d2d4..023ec99 100644 --- a/go-web-app/gowiki/cmd/gowiki/main.go +++ b/go-web-app/gowiki/cmd/gowiki/main.go @@ -161,10 +161,6 @@ func frontPageHandler(w http.ResponseWriter, r *http.Request) { func main() { log.Printf("%s\n", templates.DefinedTemplates()) - // Using function literal and closures to handle not found - // http.HandleFunc("/view/", viewHandler) - // http.HandleFunc("/edit/", editHandler) - // http.HandleFunc("/save/", saveHandler) http.HandleFunc("/view/", makeHandler(viewHandler)) http.HandleFunc("/edit/", makeHandler(editHandler)) http.HandleFunc("/save/", makeHandler(saveHandler)) @@ -173,10 +169,3 @@ func main() { log.Println("Serving on: http://0.0.0.0:5001") log.Fatal(http.ListenAndServe(":5001", nil)) } - -// func main() { -// p1 := &Page{Title: "TestPage", Body: []byte("This is a test page.")} -// p1.save() -// p2, _ := loadPage("TestPage") -// fmt.Println(string(p2.Body)) -// }