desktop: Add parameter for serving static files
See original GitHub issueThis is in regard to maputnik/desktop.
I like to propose a parameter --static
for maputnik/desktop](https://github.com/maputnik/desktop) that takes a directory (e.g. --static ./foo/bar
) and serves the contents of that directory with http.FileServer
(
http.Dir
(...))
under /static
.
The intended purpose for --static
is to be able to serve assets for the style that is designed, such as sprites and glyphs with the http.Server
that maputnik needs to spawn anyway. For example, it would be possible to edit the sprites JSON file and/or the sprites PNG on the local disk and simply reload (F5) Maputnik in the browser to refresh the icons used in the style. (For the initial implementation I’d not include file watches for static assets, maybe these could be added later, too.)
If this is of intereset to the maintainers I’d be happy to contribute a PR to maputnik/desktop.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@zstadler no worries, I tried it and didn’t find any issues. If you’ll see anything not working as expected, please open an issue to report.
Updated the binaries here and moved the idea regarding params for sprite/glyphs to https://github.com/maputnik/editor/issues/715.
@pathmapper Thanks for implementing this feature! Sorry I was unable to test it before the merge.