You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
706 B

package main
/*
type NumberImg struct {
File string `json: "file"`
Text string `json: "text"`
}
func runServer() {
router := mux.NewRouter().StrictSlash(true)
router.HandleFunc("/", Index).Methods("GET")
router.HandleFunc("/img", ImgToNumber).Methods("POST")
log.Fatal(http.ListenAndServe(":3020", router))
}
func Index(w http.ResponseWriter, r *http.Request) {
fmt.Println(r.URL.Path)
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
}
func ImgToNumber(w http.ResponseWriter, r *http.Request) {
fmt.Println(r.URL.Path)
decoder := json.NewDecoder(r.Body)
var t NumberImg
err := decoder.Decode(&t)
if err != nil {
panic(err)
}
fmt.Println(t.Text)
fmt.Fprintf(w, "data")
}*/