Just wondering if there is anyway to specify a parameter as optional in a sammy js route.
I\'ve seen somewhere that you can use
route/:foo/?:bar
this.get("#/:param1(/:param2)?", function (context) { var result = this.params['splat']; });
The only issue with this approach is param2 will start with a '/', but this can be removed easily.
'#/go' => {result[0]: 'go', result[1]: ''} '#/go/here' => {result[0]: 'go', result[1]: '/here'}