Original post

I am trying to set a variable based on the value in the curl -X POST Integer and negative numbers are working but I cannot make the decimal values to be passed, it always returns the 404 code. Can you help me? What’s wrong here?

func handlerVar(w http.ResponseWriter, r *http.Request) {
        vars := mux.Vars(r)
        log.Println("var:", vars["var"])



func main() {
        s = sse.NewServer(nil) // Create the sse server.
        defer s.Shutdown()

        router := mux.NewRouter()
        router.HandleFunc("/api/var={var:[-.,0-9]+}", handlerVar)

        srv := &http.Server{
                Handler: router,
                Addr:    "" + pb.HTTPPort,

        func() {
                log.Fatal(srv.ListenAndServe()) // start a http server