finding a bug
This commit is contained in:
@@ -32,6 +32,7 @@ func main() {
|
|||||||
climateDb = setupDb()
|
climateDb = setupDb()
|
||||||
defer climateDb.Close()
|
defer climateDb.Close()
|
||||||
http.HandleFunc("/", viewHandler)
|
http.HandleFunc("/", viewHandler)
|
||||||
|
fmt.Println("Listening on port 8001...")
|
||||||
log.Fatal(http.ListenAndServe(":8001", nil))
|
log.Fatal(http.ListenAndServe(":8001", nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
if r.PostForm != nil {
|
if r.PostForm != nil {
|
||||||
fmt.Println(r.FormValue("temp"))
|
fmt.Println(r.FormValue("temp"))
|
||||||
}
|
}
|
||||||
|
fmt.Println("Request received")
|
||||||
_, _ = fmt.Fprint(w, "<h1>Climate Stuff</h1><div>The data will show up here at some stage...</div>")
|
_, _ = fmt.Fprint(w, "<h1>Climate Stuff</h1><div>The data will show up here at some stage...</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user