This repository has been archived on 2023-05-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Go-PlayGround/webserverBasicTest/srvsinglearg.go
2022-09-01 16:41:03 +02:00

26 lines
433 B
Go

package main
import (
"fmt"
"net/http"
"io"
)
func main() {
http.HandleFunc("/", http.NotFound)
http.HandleFunc("/runtest", func(w http.ResponseWriter, r *http.Request) {
id := r.URL.Query().Get("id")
fmt.Println("id =>", id)
if (len(id) < 1) {
io.WriteString(w, "Missing arguments\n")
}else {
io.WriteString(w, "id :")
io.WriteString(w, id)
}
})
http.ListenAndServe("127.0.0.1:5000", nil)
}