Update connecting documentation (#1666)
This commit is contained in:
committed by
GitHub
parent
77c1ef36aa
commit
eac00e1200
@ -9,7 +9,10 @@ data.
|
||||
'use strict'
|
||||
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' }
|
||||
})
|
||||
|
||||
async function run () {
|
||||
const bulkResponse = await client.bulk({
|
||||
@ -83,7 +86,10 @@ send it directly to another source.
|
||||
'use strict'
|
||||
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' }
|
||||
})
|
||||
const fastify = require('fastify')()
|
||||
|
||||
fastify.post('/search/:index', async (req, reply) => {
|
||||
|
||||
Reference in New Issue
Block a user