All command available in backend tab console

This commit is contained in:
Anthony Laibe 2018-08-31 11:53:31 +01:00 committed by Pascal Precht
parent eb86bd7fbf
commit e4fd9ab3ba
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ let utils = require('../../utils/utils');
const EmbarkJS = require('embarkjs'); const EmbarkJS = require('embarkjs');
const IpfsApi = require('ipfs-api'); const IpfsApi = require('ipfs-api');
const Web3 = require('web3'); const Web3 = require('web3');
const stringify = require('json-stringify-safe');
class Console { class Console {
constructor(_embark, options) { constructor(_embark, options) {
@ -31,7 +32,7 @@ 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) => {
res.send({result}); res.send({result: stringify(result, null, 2)});
}); });
}); });
} }