I'd like to serve some static files from a Snaplet in the Snap framework. How do I do that? The documentation is not exactly clear.
I know how to add routes and stuff, but I'm stuck at two problems:
- What would I need to pass to
serveDirectory
to serve files from the snaplet directory? - How would I reference these static files in Heist templates of my snaplet? I obviously can't use absolute URLs, since I don't know the URL prefix my snaplet is eventually installed in the final application. In other words, how do I get an URL relative to the snaplet root URL in a Heist template?