Handle string

This commit is contained in:
Anthony Laibe 2018-08-31 12:00:16 +01:00
parent 295f254ea9
commit 5a455bb5d4
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ class Console {
let plugin = this.plugins.createPlugin('consoleApi', {});
plugin.registerAPICall('post', '/embark-api/command', (req, res) => {
this.executeCmd(req.body.command, (_err, result) => {
if (typeof result === 'string') {
return res.send({result});
}
res.send({result: stringify(result, null, 2)});
});
});