httprouter
httprouter copied to clipboard
Allowing only specified values of path parameter
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
Quite disappointing it's not available in this otherwise perfect router :/.