Hi I ran into an issue in routes.json. I want to hear you guys opinion before I started investigate / patching it
I have a use case for below urls:
route 1 : "/blogpost_:blogpost"
route 2 : "/:article"
What I want to do is, when a url comes, first check whether the url has a "blogpost_" prefix, if no, use the "/:article" rule.
I've tested this scenario in mojito. When I try url like "/blogpost_xxx.html", it just goes to "/:article" route.
Is this expected ?
I haven't look into how ac.url generate the regular expression for parsing it. But do you guys feel this is a valid use case and worth a patch for fixing it ? I can work on this if you guys agreed.
Furthermore, express framework support some formats like
2 variables in a /.../ region. Does mojito have plan to support thing like this ? It will be useful too.
@drewfish isn't this a case for a custom regex? Can you comment and close?
Looking in lib/app/autoload/route-maker.common.js it looks like the default regex for :token matches is [^/]+ so I'm surprised it didn't work for you. Given that, I suspect that a custom regex won't help (though it's worth a try).
This should be solved in mojito-next (0.9) which is using express 3.x routes.