Unable to use the nested groups in route segments #38

Closed
tomyeh opened this Issue Jun 25, 2013 · 2 comments

Comments

Projects
None yet
1 participant
Owner

tomyeh commented Jun 25, 2013

With Rikulo's StreamServer, is it possible to specify a route with optionnal segments ? For example, I tried to build this route pattern:

/default/(controller:\w+)/(action:\w+)(/(id:\w+))?

For matching both /default/user/get and /default/user/get/myId. In fact, this route correctly matches these 2 URLs, but when I try to get the id value with connect.dataset['id'], it's always null :s

source: http://stackoverflow.com/questions/17277819/can-rikulo-stream-use-optionnal-route-segments

Owner

tomyeh commented Jun 25, 2013

Notice: it is caused by the nested group, not the optional segments. For example, the following works correctly:

r"/default/(controller:\w+)/(action:\w+)/(id:\w+)?": yourHandler,
r"/default/(controller:\w+)/(action:\w+)": yourHandler
Owner

tomyeh commented Jun 25, 2013

Ready at d97745d

tomyeh closed this Jun 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment