Giter Club home page Giter Club logo

Comments (4)

spalger avatar spalger commented on May 18, 2024 1

Yep, the host objects closely mimic the object that node's http.request accepts as it's argument. I'm surprised that I didn't write docs for those objects; it is on my TODO list now.

In the mean time, here is a detailed list of all the keys you can use to describe a host and their defaults:

var client = new elasticsearch.Client({
  hosts: [
    {
      protocol: 'http',
      host: 'localhost', // can also be hostname: 
      path: '/', // can also be pathname:
      port: 9200,
      auth: null, // Basic authentication i.e. 'user:password' to compute an Authorization header.
      query: null, // query string, or an object which will be serialized to a query string
      headers: null // object, this is only supported in node and es.jquery.js, expect full support soon
    }
  ]
});

from elasticsearch-js.

pulkitsinghal avatar pulkitsinghal commented on May 18, 2024

I do understand that instead of trying something like:

host: {
    protocol: 'http',
    host: 'my.apigee.com',
    prefix: 'v1/proxy' // bogus, made up by me
}

I can use http://my.apigee.com/v1/proxy to get the desired effect today.

I am just curious if it can be done in a cleaner fashion like upstairs as well?

from elasticsearch-js.

spalger avatar spalger commented on May 18, 2024

Sure thing. Instead of using the prefix: key, use the path: key to accomplish this.

from elasticsearch-js.

pulkitsinghal avatar pulkitsinghal commented on May 18, 2024

thanks @spenceralger is there somethign for placing headers as well? where can the docs be updated to reflect path and header configurations?

from elasticsearch-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.