Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ElasticsearchStore.prototype.initialise = function(resourceConfig) {
var self = this;
var clientConfig = {
host: "http://localhost:9200"
};
var client = new elasticsearch.Client(JSON.parse(JSON.stringify(clientConfig)));
if (!client) {
console.error("error connecting to Elasticsearch");
} else {
self._db = client;
}
self.resourceConfig = resourceConfig;
if (!self._db) {
return elasticsearch.resourcesToInitialise.push(resourceConfig);
}
self.ready = true;
};