adjustments

This commit is contained in:
talksik
2023-09-06 13:25:05 -07:00
parent 8720100313
commit 7826fc21d5
3 changed files with 16 additions and 8 deletions
+10 -3
View File
@@ -19,9 +19,16 @@ func getStatusHandler(w http.ResponseWriter, r *http.Request) {
}
func updateStatusHandler(w http.ResponseWriter, r *http.Request) {
// TODO: read request and update statuses
// TODO: read request and update statuses
println("changing status")
println("changing status")
queryParams := r.URL.Query()
h_status := queryParams.Get("statush")
a_status := queryParams.Get("statusa")
statusOne = h_status
statusTwo = a_status
getStatusHandler(w, r)
}
@@ -32,8 +39,8 @@ func main() {
component := templates.Hello("John")
http.Handle("/hello", templ.Handler(component))
http.HandleFunc("/", getStatusHandler)
http.HandleFunc("/changestatus", updateStatusHandler)
http.HandleFunc("/", getStatusHandler)
fmt.Println("Listening on :3000")
http.ListenAndServe(":3000", nil)