Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 30, 2019 21:31
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/5ac5d2cda1df87457d7c7acfa610e0b7 to your computer and use it in GitHub Desktop.
Save parzibyte/5ac5d2cda1df87457d7c7acfa610e0b7 to your computer and use it in GitHub Desktop.
enrutador.HandleFunc("/libros/{orden:(?:ascendente|descendente)}", func(respuesta http.ResponseWriter, peticion *http.Request) {
variablesDePeticion := mux.Vars(peticion)
orden := variablesDePeticion["orden"]
respuesta.Write([]byte("Libros ordenados: " + orden))
}).Methods("GET")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment