The Service Callout Policy now has the ability to directly invoke a Node.js resource instead of going through a chained Node.js proxy. However, I’m having issues when I attempt to edit the proxy and re-deploy.
My Node resource is rather simple, pretty much the same as the Hello World example:
var http = require('http');
console.log('node.js application starting...');
var svr = http.createServer(function(req, resp) {
resp.setHeader('Content-Type', 'application/json');
resp.end(JSON.stringify({"data" : "test"}));
});
svr.listen(9000, function() {
console.log('Node HTTP server is listening');
});
I can deploy it the first time without issue, but as soon as I make an edit and then Save, I get an error message when Apigee attempts to deploy:
“The revision is deployed, but traffic cannot flow. Unexpected error occurred while processing the updates.”
From then on, I cannot deploy my proxy without deleting (or commenting out) the node code. Even deleting the Service Callout Policy, saving as a new revision, creating it again, and changing the port in Node doesn’t work.
Am I doing something wrong?