Was going through this page and came across the below:
<TargetEndpoint name="default"> <ScriptTarget> <ResourceURL>node://hello.js</ResourceURL> <EnvironmentVariables> <EnvironmentVariable name="NAME">VALUE</EnvironmentVariable> </EnvironmentVariables> <Arguments> <Argument>ARG</Argument> </Arguments> </ScriptTarget> </TargetEndpoint>
Here the VALUE cannot be dynamic?
I know, I can use apigee-access module (apigee.getVariable(req,"flow.variable")), to access these in Node. However, I do not always have access to the req parameter all the way down.
Is it possible to set dynamic arguments to Node application via the TargetEndpoint configuration?
In my use case, I would be looking up values on the KVM and these would be fetched by appropriate layers on Node. I do not have to rely on passing the req parameter all the way down, just to access the flow variable (via apigee-access). Any suggestions/alternatives on how to best achieve this?
Thanks,
Girish
Solved! Go to Solution.
Dear @Girish Gajria, you're right about setting dynamic values from variables in Node.js as environment variables. Therefore, you won't be able to leverage them for the purpose of passing values dynamically. However, based on your use case, you can leverage many other features available in Apigee Edge to retrieve dynamic variables. I'll try to sumarize the ones I'm familiar with:
Am I missing anything?