What is the best way to get target server details into my node.js backend?

Not applicable

We have a number of different Apigee environments that we use, and these environments all point to different backends.

Generally we use target servers for this purpose when configuring targets or service callouts so that we can have the same API Proxy configuration across our environments and migrate seamlessly.

How would we do this with our node.js targets though? There is no way in node.js to tap into the target servers directy, I do not want to hammer the management API with calls from node on each request.

Any ideas?

Solved Solved
0 3 774
1 ACCEPTED SOLUTION

Not applicable

Hi -- thanks for asking.

There's nothing right now that lets you extract that information from Node.js directly and easily, but based on your experience it'd be good to know if perhaps we should add an enhancement in the future.

If you can figure out another way to get that information, for instance if you can set it in a flow variable, you can retrieve it using the "apigee-access" node.js module (found on NPM).

View solution in original post

3 REPLIES 3

Not applicable

Hi -- thanks for asking.

There's nothing right now that lets you extract that information from Node.js directly and easily, but based on your experience it'd be good to know if perhaps we should add an enhancement in the future.

If you can figure out another way to get that information, for instance if you can set it in a flow variable, you can retrieve it using the "apigee-access" node.js module (found on NPM).

I don't specifically need to get at it in the node.js code per se. If I could get access in my flow that would be perfectly fine, I could use it from there.

I just don't want to have to access the management server to get it (this is OPDK BTW), it would be good if there were a policy that could do this lookup available to me in the flow (using the same lookup methods as the service callout), or perhaps if these details were available via the system variables using something like:

targetservers.<name>.host and targetservers.<name>.port etc

@Greg Brail - Yes, it would be good to have the ability to get to both "Target Servers" and "Key Value Maps". KVs are the biggest single issue for me.

This is from the perspective of trying to do everything in Node.js

Any chance this is in the works already with a projected availability date?

Thanks!