Use of "apigee-access" module in nodejs new Hosted environment.

Hi,

Apigee is discontinuing Nodejs api in Edge and suggesting to deploy Nodejs code to new Hosted server.

Is "apigee-access" module available new Nodejs Hosted server environment.

Best regards,

Amit

0 4 112
4 REPLIES 4

Is "apigee-access" module available new Nodejs Hosted server environment.

No, it is not.

https://docs.apigee.com/api-platform/nodejs/using-apigee-access

Also see the FAQ for Hosted Targets.

https://docs.apigee.com/api-platform/hosted-targets/hosted-targets-faq

Hi @Dino-at-Google

Is there any other solution to read kvm maps.
in the existing Nodejs code which is inside the Edge

we are loading the "apigee-acess" module and reading the KVM map dynamically
means the KVM map name & key is sent to the nodejs code and at run time thru the "apigee-access" we are reading the KVM values.

Is there any other way to do this in new Hosted environment.

Regards,

Amit

Yes, in fact the FAQ document I cited earlier directly addresses your question.

here's the specific question. link

The idea is: in the request flow, use a KeyValueMapOperations policy (GET) to read a value, then use the AssignMessage policy to set a custom request header with the value you obtained from the KVM. The HT code will get the value in the header.

Super simple!

Hi Dino

KeyValueMap Policy requires map identifier name and key name to be hard coded. My requirement is to not hard code it. The code (either Apigee or Nodejs) should read it dynamically. Means the Map identifier name and key will be provided as input parameters and based on the input parameter map identifier name it should read that particular kvm map.

This is the existing code in nodejs

var svr = http.createServer(function(req, resp) {
    var apigee = require('apigee-access');
    var mapname = apigee.getVariable(req,"mapname");
    var mapkey = apigee.getVariable(req,"mapkey");
    
    
    var kvm = apigee.getKeyValueMap(mapname, 'environment');
    kvm.get(mapkey, function(err, key_value) {
        console.log(key_value);
      resp.end(key_value);
    });
});
<br>

the apigee-access module helps read the KVM dynamically.

In the new hosted environment would this be possible if i deploy the above code to new hosted environment.

Regards,

Amit