Add route to get available languages

This commit is contained in:
Johannes Zellner
2020-11-18 00:10:06 +01:00
parent 2388fe5047
commit 784c8b2bd2
5 changed files with 39 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ exports = module.exports = {
prepareDashboardDomain,
renewCerts,
getServerIp,
getLanguages,
syncExternalLdap
};
@@ -313,3 +314,11 @@ function getServerIp(req, res, next) {
next(new HttpSuccess(200, { ip }));
});
}
function getLanguages(req, res, next) {
cloudron.getLanguages(function (error, languages) {
if (error) return next(new BoxError.toHttpError(error));
next(new HttpSuccess(200, { languages }));
});
}