Add software version to the api

This commit is contained in:
Frederic Guillot 2015-04-18 11:42:10 -04:00
parent 46d69b15f6
commit f7680efa18
2 changed files with 34 additions and 0 deletions

View File

@ -109,6 +109,34 @@ Array
Procedures Procedures
---------- ----------
### app.version
Get the application version.
- **Arguments:** None
- **Return:** Software version
Request:
```bash
curl \
-u "demo:swB3/nSo1CB1X2F" \
-d '{"jsonrpc": "2.0", "method": "app.version", "id": 1}' \
https://miniflux.net/demo/jsonrpc.php
```
Response:
```json
{
"jsonrpc":"2.0",
"id":1,
"result": {
"version":"master"
}
}
```
### feed.list ### feed.list
Get the list of subscriptions. Get the list of subscriptions.

View File

@ -10,6 +10,12 @@ $server->authentication(array(
\Model\Config\get('username') => \Model\Config\get('api_token') \Model\Config\get('username') => \Model\Config\get('api_token')
)); ));
// Get version
$server->register('app.version', function () {
return array('version' => APP_VERSION);
});
// Get all feeds // Get all feeds
$server->register('feed.list', function () { $server->register('feed.list', function () {