-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for omitting a filename #21
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21 +/- ##
==========================================
+ Coverage 97.51% 97.52% +<.01%
==========================================
Files 8 8
Lines 685 686 +1
==========================================
+ Hits 668 669 +1
Misses 17 17
Continue to review full report at Codecov.
|
Thanks for taking a stab at this @jczaplew! One concern is that as this is now it'll cause certain problems downstream in plugins that currently expect filename to be indicative of the mime type. The The quick fix is to make Instead of a .route('*.png') Once we get this worked out, I'd love to get this in! I have a feeling it'll make quite a few people happy. |
Sounds good @brianreavis! Makes a lot of sense. Another oddity that I'm not sure is a concern or not is that this approach will result in caches like tilestrata-disk saving the tiles as |
@brianreavis - is there anything else you would like changed on this pull? |
Oops, sorry – fell off my radar. Thanks for the nudge! Going to merge this as it is and make some subtle changes to address some of the questions you bring up. Might be easier to do it than try to articulate :) Really appreciate the work on this! |
…tyle routes + documentation / more tests
Alright, this is now out in 2.1.0. Thanks for tackling the bulk of this @jczaplew! To sum up the adjustments in e002a71:
Just as a footnote, if you want a cache layout that matches the urls for whatever reason, something like this (ish) would work: var dest = req.z + '/' + req.x + '/' + req.y;
if (req.hasFilename) {
dest += '/' + req.filename;
} else {
dest += req.filename.substring(1);
} |
Awesome! Thanks a ton @brianreavis! |
Should have done this the 2.1.0 release, but it slipped my mind.
Adds the option
noFilename
to the main tilestrata configuration parameters to allow for the{z}/{x}/{y}.{extension}
request format.While this is a global setting, I can also see arguments for having it be a route-specific parameter.
To use it, simply pass
{noFilename: true}
when initializing the the tileserver, and pass the file extension in place of the filename (.route('png')
) .Let me know what you think!