Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 30, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a5c3cefec49720a3b7507317c71b2fe3 to your computer and use it in GitHub Desktop.
Save parzibyte/a5c3cefec49720a3b7507317c71b2fe3 to your computer and use it in GitHub Desktop.
enrutador.HandleFunc("/pedidos/{anio:[0-9]{4}}", func(respuesta http.ResponseWriter, peticion *http.Request) {
variablesDePeticion := mux.Vars(peticion)
anio := variablesDePeticion["anio"]
respuesta.Write([]byte("Pedidos del año: " + anio))
}).Methods("GET")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment