Created
December 13, 2017 16:57
-
-
Save kartikag01/21a880dd7119220d4418df4d08cf42c4 to your computer and use it in GitHub Desktop.
nodejs elastic connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import elasticsearch from "elasticsearch"; | |
| let elasticClient; | |
| export const getElasticInstance = () => { | |
| if (elasticClient) | |
| return elasticClient; | |
| elasticClient = new elasticsearch.Client({ | |
| host: 'localhost:9200' | |
| }); | |
| return elasticClient; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment