Skip to content
Snippets Groups Projects
Commit 37ca3c00 authored by Arthur E. Jones's avatar Arthur E. Jones Committed by James Long
Browse files

feat: add get-server-version handler

parent 7d31c517
No related branches found
No related tags found
No related merge requests found
......@@ -1496,6 +1496,24 @@ handlers['subscribe-sign-out'] = async function() {
return 'ok';
};
handlers['get-server-version'] = async function() {
if (!getServer() || getServer().BASE_SERVER === UNCONFIGURED_SERVER) {
return { error: 'no-server' };
}
let version;
try {
const res = await get(getServer().BASE_SERVER + '/info');
const info = JSON.parse(res);
version = info.build.version;
} catch (err) {
return { error: 'network-failure' };
}
return { version };
};
handlers['get-server-url'] = async function() {
return getServer() && getServer().BASE_SERVER;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment