Answers for "golang http web server"

Go
0

golang http server

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
  data := map[string]string{"name": "john doe"}
  json.NewEncoder(w).Encode(data)
})

http.ListenAndServe(":3000", nil)
Posted by: Guest on April-09-2022

Browse Popular Code Answers by Language