mystor / meteor-routecore

Client and server side rendering/routing powered by React
84 stars 6 forks source link

optional params not working on server side #12

Open pahans opened 9 years ago

pahans commented 9 years ago

hi @mystor it seems optional params are not working in server side code.

sample code

RouteCore.map(function() {
  this.route('/:required/:optional?', function(){
    //code
  }
});

If I visited http://localhost:3000/required/optional it is working. but for http://localhost:3000/required/ it is not working.

mystor commented 9 years ago

It appears as though connect-route doesn't actually support optional parameters, which would cause this behavior (I could've sworn it did). This is really unfortunate. I'm actually looking into switching out my url pattern-matching back-end, so that it is the same code on both the client and the server, (I'll probably switch to the same one that iron:router uses), so the problem should go away in a new version.

Thanks for the bug report :)

leebenson commented 9 years ago

@mystor any update on this? This recently caught me out too... thanks for your hard work on this, it's currently the best way to get React playing with Meteor!

mystor commented 9 years ago

@leebenson I have a partially-working branch on my local machine, but I just haven't had the chance to get it to a polished & working state due to all of the other things I have going on right now. I would accept a pull-request, and I'll keep it on my radar, but no guarantees I can fix this super soon :-/ sorry.