This commit is contained in:
Manuel Knitza 2013-02-12 12:38:57 -08:00
commit 37534e1027
2 changed files with 13 additions and 0 deletions

View file

@ -216,6 +216,9 @@ var version =
}
};
// set the latest available API version here
exports.latestApiVersion = '1.2.7';
/**
* Handles a HTTP API call
* @param functionName the name of the called function
@ -288,6 +291,11 @@ exports.handle = function(apiVersion, functionName, fields, req, res)
}
else
{
if(functionName == "getLatestApiVersion")
{
res.send({code: 0, message: "latest API version", data: latestApiVersion});
return;
}
callAPI(apiVersion, functionName, fields, req, res);
}
}

View file

@ -57,4 +57,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
res.end("OK");
});
});
//Provide a possibility to query the latest available API version
args.app.get('/api', function (req, res) {
res.json({"currentVersion" : apiHandler.latestApiVersion});
});
}