Got a simple question I canāt seem to find an answer to.
On my .js file I have console.log that I hope to spit out the version number of the running ParseServer.
But I canāt figure out where to get the information. Does the ParseServer instance have that information or maybe somewhere else?
app.listen(1337, function() {
console.log('parse-server version: ' + server.version); // server version here?
console.log('parse-server: running on port 1337.');
});
Basically how is ParseDashboard showing the server version?
Parse Dashboard gets the Parse Server version via the serverInfo endpoint providing the masterKey, for example:
http://example.com/parse/serverInfo
To generate the response for that endpoint, Parse Server gets the version directly from package.json via:
import { version } from '../../package.json';
So I donāt believe that the version is exposed as a property of the Parse Server instance. But it seems a good idea. Please feel free to open a feature request.
Iāve used the following in Job code to get the server version and some other info:
//let serverHealth = await Parse.getServerHealth(); // Not available until JS SDK 4.0.1 (we are on 2.19.0 as of Parse Server 4.5.0 (20Feb2023))
let serverHealth = await Parse.CoreManager.getRESTController().request('GET', 'health');
console.log("Server Health: %s", JSON.stringify(serverHealth));
let serverVersion = Parse.CoreManager.get('VERSION');
console.log("Server Version: %s", JSON.stringify(serverVersion));
Correct, that would be the Parse JS SDK version. So maybe the feature doesnāt exist yet after all. It should be a simple PR to expose a server version property within Cloud Code.