flatiron / director

a tiny and isomorphic URL router for JavaScript

Home Page:http://github.com/flatiron/director

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in url-matching when ended with "/"

bigomega opened this issue · comments

From the given example in README

      var routes = {
        '/author': author,
        '/books': [books, function() {
          console.log("An inline route handler.");
        }],
        '/books/view/:bookId': viewBook,

        // I ADDED THIS
        '*': function(){console.log('default');}
      };

when i give the url #/books/view/ or #/books/ none of the functions are called.
Yes really... 😨

make this rule works, have to set like `'/author/?' :-(

Well that makes sense... sad though :(