-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
I'm trying to get http-aws-es working in a browser application using the elasticsearch-js library. My code is currently looking like this but I'm getting a "TypeError: invalid host" in the browser console.
`
let AWS = require('aws-sdk')
let options = {
hosts: ['https://my-es-host.es.amazonaws.com'],
connectionClass: require('http-aws-es'),
awsConfig: new AWS.Config({
credentials: new AWS.Credentials('AKA...', 'secret'),
region: 'eu-central-1'
}),
httpOptions: {}
}
let es = require('elasticsearch-browser').Client(options)
es.ping({
requestTimeout: 30000
}, function (error) {
if (error) {
console.error('elasticsearch cluster is down!')
} else {
console.log('All is well')
}
})`
Did anyone get a similar setup working in the browser and what am I doing wrong?
Metadata
Metadata
Assignees
Labels
No labels