mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Initial work on swagger
This commit is contained in:
parent
fe0272b283
commit
1cfc8eda19
4 changed files with 387 additions and 2 deletions
|
@ -219,6 +219,9 @@ var version =
|
|||
// set the latest available API version here
|
||||
exports.latestApiVersion = '1.2.7';
|
||||
|
||||
// exports the versions so it can be used by the new Swagger endpoint
|
||||
exports.version = version;
|
||||
|
||||
/**
|
||||
* Handles a HTTP API call
|
||||
* @param functionName the name of the called function
|
||||
|
@ -266,6 +269,8 @@ exports.handle = function(apiVersion, functionName, fields, req, res)
|
|||
}
|
||||
|
||||
//check the api key!
|
||||
fields["apikey"] = fields["apikey"] || fields["api_key"];
|
||||
|
||||
if(fields["apikey"] != apikey.trim())
|
||||
{
|
||||
res.send({code: 4, message: "no or wrong API Key", data: null});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue