Handle string
This commit is contained in:
parent
e4fd9ab3ba
commit
e31f4778ac
|
@ -32,6 +32,9 @@ class Console {
|
||||||
let plugin = this.plugins.createPlugin('consoleApi', {});
|
let plugin = this.plugins.createPlugin('consoleApi', {});
|
||||||
plugin.registerAPICall('post', '/embark-api/command', (req, res) => {
|
plugin.registerAPICall('post', '/embark-api/command', (req, res) => {
|
||||||
this.executeCmd(req.body.command, (_err, result) => {
|
this.executeCmd(req.body.command, (_err, result) => {
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
return res.send({result});
|
||||||
|
}
|
||||||
res.send({result: stringify(result, null, 2)});
|
res.send({result: stringify(result, null, 2)});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue