Merge pull request #1512 from disy-mk/patch-3

Allow people to query current API version via /api
This commit is contained in:
Marcel Klehr 2013-02-13 03:39:32 -08:00
commit 602d603658
3 changed files with 11 additions and 1 deletions

View File

@ -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

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

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});
});
}