kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 194 forks source link

Is it possible to define one route with a param and without one #516

Closed rootedsoftware closed 8 years ago

rootedsoftware commented 8 years ago

Here is an example of what I mean by my question.

authenticatedRoutes.route( '/people/:_id', {
  name: 'people',
  action() {
    BlazeLayout.render( 'main', { yield: 'People' } );
  }
});

Is there a way to make both of these URLs work with one route?

https://myapp.mydomain.com/people https://myapp.mydomain.com/people/PKsads3343ss

arunoda commented 8 years ago

Check this to learn more about path definition syntax. See: https://github.com/pillarjs/path-to-regexp#optional

path-to-regexp is the project we use internally for path definitions.