Closed anil614sagar closed 8 years ago
var http = require('http');
var apigee = require('apigee-access');
console.log('node.js application starting...');
var svr = http.createServer(function(req, resp) {
var key = 'cachedDataKey'; // just key name
// cacheResourceName
var customCache = apigee.getCache('apigeeAccessCache',
{ scope: 'global'} );
console.log("hello");
customCache.get(key, function (err, data) {
console.log("value is " + data);
resp.writeHead(200, {"Content-Type": "application/json"});
resp.end(JSON.stringify({
err: err,
data: {
key: key,
value: data ? data : 'undefined'
}
}));
});
});
svr.listen(9000, function() {
console.log('Node HTTP server is listening');
});
It works as expected, i messed up keys & cache name
Unable to retrieve cache value populated using Popualate Cache Policy. It works using Lookup cache policy, but it doesn't work using Apigee Access,
`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>