Web server test
This commit is contained in:
@@ -68,8 +68,12 @@ func main() {
|
|||||||
|
|
||||||
if *http_port != -1 {
|
if *http_port != -1 {
|
||||||
http.HandleFunc("/switch", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/switch", func(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintf(w, "%q", r.URL.RawQuery)
|
fmt.Fprintf(w, "%q", r.URL.Query())
|
||||||
n.Switch(7)
|
err := n.Switch(7)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(w, "%q", err)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
http.ListenAndServe(":8080", nil)
|
http.ListenAndServe(":8080", nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user