mirror of https://github.com/embarklabs/embark.git
All command available in backend tab console
This commit is contained in:
parent
eb86bd7fbf
commit
e4fd9ab3ba
|
@ -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)});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue