about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/http.go b/src/http.go
index 88326fc..e08ed68 100644
--- a/src/http.go
+++ b/src/http.go
@@ -54,8 +54,6 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) {
 	// get all challenges from the db
 	challs := getAllChallenges(db)
 
-	log.Println("got all challenges")
-
 	// define a challenges struct storing the challenges.
 	// This struct can be used in a template
 	challenges := Challenges{}
@@ -64,12 +62,7 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) {
 		challenges.Challenge = append(challenges.Challenge, chal)
 	}
 
-	log.Println("Done inserting all the challengesi nto the challenges struct")
-
-	fmt.Printf("challenges: %#v\n", challenges)
-
-	log.Println("Generating a new template used to render the challenges")
-
+	// define a new template to render the challenges in
 	t := template.New("")
 	t, err := t.ParseFiles("./hosted/view.html")
 	if err != nil {
@@ -77,14 +70,8 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	log.Println("Done generating and parsing the template")
-
+	// execure the template using the challenges struct
 	t.ExecuteTemplate(w, "view", challenges)
-
-	log.Println("Done executing the template")
-
-	// read the view.html file and write its content to the response writer
-	//readFileToResponse(w, "/view.html")
 }
 
 func editGetHandler(w http.ResponseWriter, r *http.Request) {