Consider 3 Cloud Functions:
- cf1
- cf2
- cf3
I have created a LoadBalancer with:
- URL mask
/functions/<function>
- Removing prefix to
/
So now, I can run the CloudFunctions as:
- https://mydoma.in/functions/cf1/one/two
- https://mydoma.in/functions/cf2/three/four
- https://mydoma.in/functions/cf2/five/six
Thanks to point 2, the CloudFunction receives following path:
- cf1 receives
/cf1/one/two
- cf2 receives
/cf2/three/four
- cf3 receives
/cf3/five/six
However, the /cf*
part is not desired, because it was only used to determine which CloudFunction to launch. Is there a way to remove this so that the functions receive only the paths which are relevant to them?
- cf1 would receive:
/one/two
- cf2 would receive:
/three/four
- cf3 would receive:
/five/six
The very same thing applies to our Cloud Run services where I would like to achieve the same thing.
If you're looking for some sort of switch or configuration for this, it doesn't exist. You're going to have to write code to parse the actual URL path and extract the data you want out of it, ignoring anything you don't find relevant to the rest of the function's behavior.