@dreesq/serpent
Version:
An express wrapper for developing fast web applications
27 lines (21 loc) • 401 B
JavaScript
const {Client} = require('@elastic/elasticsearch');
/**
* Elastic search object
* @type {boolean}
*/
let client = false;
/**
* Plugin initialization
* @param context
*/
exports.init = async context => {
const {config} = context.plugins;
client = new Client(config.get('plugins.es'));
};
/**
* Export the client
* @type {boolean}
*/
exports.build = req => {
return client;
};