Add back console command

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

View File

@ -24,6 +24,16 @@ class Console {
this.events.setCommandHandler("console:history", (cb) => this.getHistory(process.env.DEFAULT_CMD_HISTORY_SIZE, cb));
this.registerEmbarkJs();
this.registerConsoleCommands();
this.registerApi();
}
registerApi() {
let plugin = this.plugins.createPlugin('consoleApi', {});
plugin.registerAPICall('post', '/embark-api/command', (req, res) => {
this.executeCmd(req.body.command, (_err, result) => {
res.send({result});
});
});
}
processEmbarkCmd (cmd) {