diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 0543ef71a..7e05ff86d 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -61,7 +61,9 @@ Portal submits content into new blog post ## Usage ### API version -The latest version is `1.2` +The latest version is `1.2.7` + +The current version can be queried via /api. ### Request Format diff --git a/src/node/handler/APIHandler.js b/src/node/handler/APIHandler.js index 9f86277a0..8be5b5fe3 100644 --- a/src/node/handler/APIHandler.js +++ b/src/node/handler/APIHandler.js @@ -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 diff --git a/src/node/hooks/express/apicalls.js b/src/node/hooks/express/apicalls.js index e57e1d350..0971a877b 100644 --- a/src/node/hooks/express/apicalls.js +++ b/src/node/hooks/express/apicalls.js @@ -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}); + }); }