move configure webadmin and status out of setup logic

This commit is contained in:
Girish Ramakrishnan
2018-11-11 09:29:11 -08:00
parent b640a053e3
commit aae259479f
5 changed files with 113 additions and 103 deletions

View File

@@ -10,7 +10,8 @@ exports = module.exports = {
feedback: feedback,
checkForUpdates: checkForUpdates,
getLogs: getLogs,
getLogStream: getLogStream
getLogStream: getLogStream,
getStatus: getStatus,
};
var appstore = require('../appstore.js'),
@@ -166,3 +167,11 @@ function getLogStream(req, res, next) {
logStream.on('error', res.end.bind(res, null));
});
}
function getStatus(req, res, next) {
cloudron.getStatus(function (error, status) {
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, status));
});
}