Dears ,
I have problem where i require elasticsearch library node.js app on apigee on-premise
Message Eroor
Elastic.js
var elasticsearch = require('elasticsearch'); var client = new elasticsearch.Client({ host: 'localhost:9200', log: 'trace' }); client.ping({ // ping usually has a 3000ms timeout requestTimeout: 1000 }, function (error) { if (error) { console.trace('elasticsearch cluster is down!'); } else { console.log('All is well'); } });
package.json
{ "name": "Elastic", "version": "1.2.3", "description": "ElasticSearch", "main": "elastic.js", "private": true, "dependencies": { "elasticsearch": "x.x.x", "module-js": "7.0.1", "apigeetool": "0.10.0" } }
As you install
As mentioned, you should be installing these modules and then re-deploy your proxy,
https://community.apigee.com/articles/1531/how-to-import-a-nodejs-module-to-apigee-edge.html
I hope you are aware of Apigee Nodejs - There are some drawbacks. The main one is the Trireme runtime is based on node 0.10.32. It's pretty old. And so it does not support ES6 including Promises, let/const, arrow function syntax, destructuring assignments, and so on. And that also means you cannot use the latest versions of various modules
Since you are using On-Prem...we cannot recommend Hosted Targets.
https://docs.apigee.com/api-platform/hosted-targets/hosted-targets-overview
Yes I know for that , So I develop node app
Can you see the bug @Anil Sagar @ Google