2a7267a35a
* add containers for OpenSearch * switch OpenSearch Dashboards to http * add script to take care of index/mapping on first run * limit mount in opensearch container to only the necessary scope * handle both docker and non-docker dev setups * cleanup * make opensearch work in docker dev --------- Co-authored-by: rleed <rleed1@pm.me> Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
16 lines
422 B
JavaScript
16 lines
422 B
JavaScript
import os from '@opensearch-project/opensearch'
|
|
|
|
const options = process.env.NODE_ENV === 'development'
|
|
? { node: process.env.OPENSEARCH_URL || 'http://localhost:9200' }
|
|
: {
|
|
node: process.env.OPENSEARCH_URL,
|
|
auth: {
|
|
username: process.env.OPENSEARCH_USERNAME,
|
|
password: process.env.OPENSEARCH_PASSWORD
|
|
}
|
|
}
|
|
|
|
global.os = global.os || new os.Client(options)
|
|
|
|
export default global.os
|