18 lines
468 B
JavaScript
18 lines
468 B
JavaScript
|
|
'use strict';
|
||
|
|
|
||
|
|
exports = module.exports = {
|
||
|
|
getConfig,
|
||
|
|
};
|
||
|
|
|
||
|
|
const BoxError = require('../boxerror.js'),
|
||
|
|
dashboard = require('../dashboard.js'),
|
||
|
|
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||
|
|
safe = require('safetydance');
|
||
|
|
|
||
|
|
async function getConfig(req, res, next) {
|
||
|
|
const [error, cloudronConfig] = await safe(dashboard.getConfig());
|
||
|
|
if (error) return next(BoxError.toHttpError(error));
|
||
|
|
|
||
|
|
next(new HttpSuccess(200, cloudronConfig));
|
||
|
|
}
|