These are chat archives for gin-gonic/gin

Aug 2015
Pyry Avist
Aug 17 2015 05:44
Hi, new guy here, just started testing Gin and run into question, maybe you guys could help: What is the best way to instrument path like /Z/X/Y.png where each of the parameters can change e.g. /1/0/1.png etc., /:Z/:X/:Y.png does not work, (Y=""), and doing /:Z/:X/:Y/tile.png seems awkward...
Pyry Avist
Aug 17 2015 05:54
Guess best way to go about is just to leave it /:Z/:X/:Y and then just take care of the .png ext. within the handler...
Javier Provecho Fernandez
Aug 17 2015 22:40
@pyry if you are serving a directory, I suggest you to check out static file serving
@pyry if the route is completely computed, your last solution seems fine
@pyry finally if there is always going to exist a png at the end of each handler, I suggest you to use a catch all parameter (*)
@pyry I forget to tell you, that managing this inside the handlers does not give you much trouble, just strip the extension safely using a common library.