Provides a set of helper functions to integrate the service into Franz.
Validate if the given URL is a valid service instance.
stringURL
// RocketChat integration
module.exports = (Franz) => {
class RocketChat extends Franz {
validateServer(URL) {
const api = `${URL}/api/info`;
return new Promise((resolve, reject) => {
$.get(api, (resp) => {
if (typeof(resp) === 'object' && 'build' in resp) {
resolve();
} else {
reject();
}
}).fail(reject);
});
}
}
return RocketChat;
};