Open
Description
Is your feature request related to a problem? Please describe.
Path route rule supported by BFE is req_path_in(/user)
, req_path_prefix_in(/user)
, req_path_suffix_in(user)
which deals with path like /user
, /user.*
or .* user
. But what if i want to add route rule like RESTFUL API path /teams/{teamId}/users/{userId}
.
Describe the solution you'd like
Support a kind of conditional primitive to solve path like /teams/{teamId}/users/{userId}
and extract params to request.
As route_rule: {req_params(/teams/{teamId}/users/{userId}), clusterName: "cluster"}
, when facing with request's path: /teams/1/users/3
BFE could:
- match route rule and send the traffic to
cluster
; - extract variables of the path and save the variables in request
{"teamId": "1", "userId": "3"}
;
Describe alternatives you've considered
Here is the example: mux