mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
Merge pull request #1512 from disy-mk/patch-3
Allow people to query current API version via /api
This commit is contained in:
commit
602d603658
3 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue