Using NodeJS to make outgoing request

Hi everyone,

I want to make outgoing https request using node js. To make that happen, I need to import key and cert file.

In the Apigee Documentation, it says:

You can make outgoing requests with the tls module the same way you would normally in Node.js. Basically, you need to add client-side keys and certificates (.pem files) to the resources/node directory and load them inside your script.

My question is:

How can I upload my key and cert file to the resources/nodedirectory?
Note: I build the nodejs script in the edge UI on top of existing api proxy, so using apigeetool may not an option if it can affect the existing proxy configuration.

Regards,

Yoga

0 2 310
2 REPLIES 2

You can use the Admin API to add a resource to the node folder.

The doc is here.

Example:

curl -X POST --header "Content-Type: application/octet-stream" -d @mypemfile.pem -n -I "https://api.enterprise.apigee.com/v1/organizations/org_name/apis/api_name/revisions/revision_number/resourcefiles?name=mypemfile.pem&type=node"

How if I use Apigee on-premise?

Note: I connect to Edge UI using VPN Client