JavaScript Client Library for fhq-server: https://github.com/freehackquest/fhq-server.git
npm install --save freehackquest-libclient-web-js
Include script dist/freehackquest-libclient-web-js.js
fhq.bind('notify', function(data){
console.log('notify: ' + JSON.stringify(data))
});
fhq.bind('connected', function(data) {
console.log('connected: ' + JSON.stringify(data))
});
fhq.bind('disconnected', function(data) {
console.log('disconnected: ' + JSON.stringify(data))
});
fhq.bind('userdata', function(data) {
console.log('userdata: ' + JSON.stringify(data))
});
// connect
fhq.init({
'baseUrl': ws://' + window.location.hostname + ':1234/api-ws/
});
// for disconnect call fhq.deinit()
After success connection you can call API.md