legit icon indicating copy to clipboard operation
legit copied to clipboard

Traversing subdirectories

Open daenney opened this issue 2 years ago • 4 comments

First off, thanks for legit, it's rather neat!

I was looking at how to make it support traversing subdirectories and so far I have the necessary infrastructure in place that would let me do this, including being able to limit the recursion depth.

The problem I'm running into is flow and its URL path handling:

mux.HandleFunc("/:name", d.Multiplex, "GET", "POST")

Unsurprisingly, /:name only captures a single segment. But when you have subdirectories you need either /:parent/:name or /:name. If I can assume there's only max 1 parent this can be solved without much trouble. But if there's a desire to allow for an arbitrary path depth it becomes problematic as the wildcard ... can only be used once and only at the end of a path. I'm not sure how to consume multiple path segments.

I'm wondering if you've given any thought around how to solve this?

daenney avatar Jan 02 '23 16:01 daenney