app.get('/blog', loadEntries);
app.get('/blog', showEntries);
app.put('/blog', createEntry);
app.get('/blog/new', createEntryForm);
app.get('/blog/:title', loadEntry);
app.get('/blog/:title', showEntry);
The problem is, a request for /blog/new matches both the "/blog/new" and "/blog/:title" routes. Ithought I'd be able to resolve the conflict like this:
app.get('/blog/_new', createEntryForm);
app.get('/blog/:title([^_].*)', loadEntry);
...
However, that doesn't work; the capture pattern is normalized, resulting in a route that matches with this regex:
^\/blog\/(?:([^_](.+)))\/?$
i.e. "/blog/" followed by a literal "." followed by one or more characters... Removing the "." from the pattern doesn't fully fix things, either, because that (.+) term is introducing an additional capture group.
I can live with dropping the ".", but that extra capture group really looks like a bug to me... Is it intentional? If not, I'l send a pull request with a fix and move on ;-) If it is, how do I set up a route in such a way that usurps other routes that would match?
Hope that makes sense...
--
Laurie Harper
http://laurie.holoweb.net/
--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.