0

I need to call my elastic search url without port number from elastisearch.js client from angular5

I need to call the elasticsearch url without port like this

'https://myelasticsearch-api.xyz.com/api1/1.0'

but it always appending default port like this

'https://myelasticsearch-api.xyz.com:9200/api1/1.0'

private connect() {
    this.client = new Client({
    host: {
        host: 'myelasticsearch-api.xyz.com',
        port: '', 
        protocol:'https',
        headers: {
          'authorization': 'Bearer ' + this.accessTolken,
        },
        path:'/api1/1.0'
      },
      log: 'warning'
    });
}
Zoe
  • 27,060
  • 21
  • 118
  • 148
MPPNBD
  • 1,566
  • 4
  • 20
  • 36

1 Answers1

0

Eventually, I am able to achieve this by using the default ssl port 443

private connect() {
 this.client = new Client({
 host: {
    host: 'myelasticsearch-api.xyz.com',
    port: 443, 
    protocol:'https',
    headers: {
      'authorization': 'Bearer ' + this.accessTolken,
    },
    path:'/api1/1.0'
  },
  log: 'warning'
 });
}

Now able to access the url 'https://myelasticsearch-api.xyz.com/api1/1.0'

MPPNBD
  • 1,566
  • 4
  • 20
  • 36