blob: b6e38db5a074981aee22da255ac79408620c3bfd [file]
//tag::conf1[]
const IgniteClient = require('apache-ignite-client');
const IgniteClientConfiguration = IgniteClient.IgniteClientConfiguration;
const igniteClientConfiguration = new IgniteClientConfiguration('127.0.0.1:10800');
const igniteClient = new IgniteClient(function onStateChanged(state, reason) {
if (state === IgniteClient.STATE.CONNECTED) {
console.log('Client is started');
} else if (state === IgniteClient.STATE.DISCONNECTED) {
console.log('Client is stopped');
if (reason) {
console.log(reason);
}
}
});
//end::conf1[]
igniteClient.connect(igniteClientConfiguration).then(() => igniteClient.disconnect());