mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-15 03:26:53 -04:00
Merge 65f1b9c6aa
into 14dca92692
This commit is contained in:
commit
37534e1027
2 changed files with 13 additions and 0 deletions
|
@ -216,6 +216,9 @@ var version =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// set the latest available API version here
|
||||||
|
exports.latestApiVersion = '1.2.7';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a HTTP API call
|
* Handles a HTTP API call
|
||||||
* @param functionName the name of the called function
|
* @param functionName the name of the called function
|
||||||
|
@ -288,6 +291,11 @@ exports.handle = function(apiVersion, functionName, fields, req, res)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(functionName == "getLatestApiVersion")
|
||||||
|
{
|
||||||
|
res.send({code: 0, message: "latest API version", data: latestApiVersion});
|
||||||
|
return;
|
||||||
|
}
|
||||||
callAPI(apiVersion, functionName, fields, req, res);
|
callAPI(apiVersion, functionName, fields, req, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,4 +57,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
res.end("OK");
|
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