TypeScript

Initialize GoEasy

import GoEasy = require('./goeasy-1.0.3.js');

//Initialize GoEasy
let goEasy = new GoEasy({
  host: 'hangzhou.goeasy.io',//Your application region: [hangzhou.goeasy.io |singapore.goeasy.io]
  appkey: 'my_appkey'//Replace it with your own appkey
});

Receive messages

goEasy.subscribe({
    channel: "my_channel", //Replace it with your own channel
    onMessage: function (message) {
        console.log("Channel:" + message.channel + " content:" + message.content);
    }
});

Publish messages

goEasy.publish({
    channel: "my_channel", //Replace it with your own channel
    message: "Hello, GoEasy!" //Replace it with your own message
});

results matching ""

    No results matching ""