httprouter icon indicating copy to clipboard operation
httprouter copied to clipboard

Allowing only specified values of path parameter

Open antimatter96 opened this issue 8 years ago • 1 comments

I want routes like

/savings/all/:userid     

/savings/:service/:userid

The service is limited to say 7. Small enough to do something like /savings/{ec2 || emr || ops}:service but large that we cant write different handlers for all. Is there any way to limit this type of usage ?

Since service are currently only 3 letter words, can we do something like

/savings/[a-z]{3}:service/:userid     

/savings/summary/:userid

Edit: Currently I am doing

/savings/aws/all/:userid"
/savings/aws/:service/:userid"

But it gives existing wildcards

antimatter96 avatar Jun 30 '17 06:06 antimatter96

Quite disappointing it's not available in this otherwise perfect router :/.

meeDamian avatar Oct 12 '19 21:10 meeDamian