Open stuartpb opened 8 years ago
@sintaxi makes a good point about restricting routes based on requested MIME type: this might be a sensible case for a directive.
Actually, since it's just a component of the match, I think there's an uglier but more sensible solution here than directives - I'll file a new issue.
Right now, only lines that start with a
/
are treated as route specifiers. Earlier drafts of this entertained the idea of allowing relative paths to be specified by not leading with a/
(the way browsers treat them).I'm now definitively against the idea of making paths acceptable when not starting with
/
: keeping letters-at-the-beginning-of-the-line as a reserved namespace opens the door for some kind of expansion likeinclude
directives, using just the keyword.Of course, I don't think this spec should ever actually have
include
directives (if you want to make a framework that modularizes its routing, just have it process those modules into a_spaspec/routes
when building/deploying), but it's a smart namespace to reserve nonetheless.(On this same note:
//
at the start of a path will probably be for host-based routes, and, in the unlikely event/**/
is ever insufficient for global routing and there needs to be some kind of "relative" route specifier,./
will do fine. That'd probably be what said modular routing compiler would use, actually.)