Uint8Array differences

Not applicable

Hi,

If I run this within node as a 'stand alone' application it executes without issue. The code is based around a basic API proxy created within Apigee, with the use of Uint8Array the only real addition.

var http = require('http');
console.log('node.js application starting...');
console.log(process.versions);


var bytes = new Uint8Array(10);


var svr = http.createServer(function(req, resp) {
    resp.end('Hello, World!');
});
svr.listen(9000, function() {
    console.log('Node HTTP server is listening');
});

However, if I run it as an Apigee Proxy I get the following error:

*** ReferenceError: "Uint8Array" is not defined. at /organization/environment/api/hello-world.js:5 at module.js:456 at module.js:474 at module.js:356 at module.js:312 at module.js:497 at startup (trireme.js:142) at trireme.js:923

I understood Uint8Array to be an inherent type within javascript, so not sure why I am seeing a difference when running within the Apigee framework?

Thanks....

Solved Solved
1 3 760
2 ACCEPTED SOLUTIONS

Not applicable

Hi @Stacey Jackson , I've just tried your code on my org and it works fine. My free org is running on 16.04.27.

$ curl http://testmyapi-test.apigee.net/unit8array
Hello, World!%

What version of Apigee are you running on?

Apigee Edge depends on trireme for nodejs support. Trireme added support for typed arrays (like UInt8Array, Int32Array, etc) in version 0.8.6. This was first available, I believe in January 2016 in the Edge public cloud. For Edge OPDK (customer managed deployment), I don't know the version. But it is possible to update Trireme in OPDK, to get this support. Contact the Apigee support desk for assistance.

more details here.

View solution in original post

See this link for some context.

Previously the Uint8Array and other typed array types were not supported. They are now.

This code should work now, with all latest Apigee Edge (Cloud or customer-managed (aka OPDK)).

View solution in original post

3 REPLIES 3

Not applicable

Hi @Stacey Jackson , I've just tried your code on my org and it works fine. My free org is running on 16.04.27.

$ curl http://testmyapi-test.apigee.net/unit8array
Hello, World!%

What version of Apigee are you running on?

Apigee Edge depends on trireme for nodejs support. Trireme added support for typed arrays (like UInt8Array, Int32Array, etc) in version 0.8.6. This was first available, I believe in January 2016 in the Edge public cloud. For Edge OPDK (customer managed deployment), I don't know the version. But it is possible to update Trireme in OPDK, to get this support. Contact the Apigee support desk for assistance.

more details here.

Not applicable

There is already a discussion here.

See this link for some context.

Previously the Uint8Array and other typed array types were not supported. They are now.

This code should work now, with all latest Apigee Edge (Cloud or customer-managed (aka OPDK)).