From 4d84bdadaf691a7258f18f0055f3da1d28bbf617 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 19 Oct 2019 00:54:49 +0200 Subject: printing all the challenge names --- src/http.go | 10 ++++++++-- 1 file 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) { -- cgit 1.4.1