This looks good, and has a nice small API surface. A couple of thoughts:
I love how the repo is only the 5 necessary files (not even a .gitignore :-). No fluff, no subdirectories.
I think the ^ and $ anchors in the regex matching should be implicit – I think people will forget them. Also, when would you not want to match the whole thing for routing? (And in the rare cases you do, just add a .*.)
I appreciate his lack of focus on performance (it really isn’t a bottleneck for almost all web apps / services). But compiling the regexes dynamically on every request seems rather unnecessary. I see there’s a suggestion from Carl M Johnson to fix that here.
This looks good, and has a nice small API surface. A couple of thoughts:
.gitignore
:-). No fluff, no subdirectories.^
and$
anchors in the regex matching should be implicit – I think people will forget them. Also, when would you not want to match the whole thing for routing? (And in the rare cases you do, just add a.*
.)How do you get access to the path params, via
r.Context()
?EDIT:
flow.Param(r.Context(), "name")