about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-19 00:54:49 +0200
committerEmile <hanemile@protonmail.com>2019-10-19 00:54:49 +0200
commit4d84bdadaf691a7258f18f0055f3da1d28bbf617 (patch)
tree522a0a3cb0425625dfd474eb121fb7faca985344 /src
parent8d099e0a80d010957d38be4ab0314ad495b938e6 (diff)
printing all the challenge names
Diffstat (limited to 'src')
-rw-r--r--src/http.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/http.go b/src/http.go
index 6ba657a..6dd9485 100644
--- a/src/http.go
+++ b/src/http.go
@@ -50,8 +50,14 @@ func createPostHandler(w http.ResponseWriter, r *http.Request) {
 }
 
 func viewGetHandler(w http.ResponseWriter, r *http.Request) {
-	log.Println("ciew GET")
-	readFileToResponse(w, "/view.html")
+	// get all challenges from the db
+	challenges := getAllChallenges(db)
+	for _, chal := range challenges {
+		fmt.Println(chal.name)
+	}
+
+	// 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) {