2022-01-28 12:37:23 -06:00

15 lines
392 B
JavaScript

const os = require('@opensearch-project/opensearch')
global.os = global.os || new os.Client(
process.env.NODE_ENV === 'production'
? {
node: process.env.OPENSEARCH_URL,
auth: {
username: process.env.OPENSEARCH_USERNAME,
password: process.env.OPENSEARCH_PASSWORD
}
}
: { node: 'http://localhost:9200' })
module.exports = global.os