mirror of https://github.com/embarklabs/embark.git
add event and API end poitn to get the JSON info of a contract
This commit is contained in:
parent
21440505e1
commit
23bd2c91a7
|
@ -21,6 +21,19 @@ class Deploy {
|
|||
this.events.setCommandHandler('setDashboardState', () => {
|
||||
self.events.emit('contractsState', self.contractsManager.contractsState());
|
||||
});
|
||||
|
||||
self.events.setCommandHandler("contracts:contract", (contractName, cb) => {
|
||||
cb(self.contractsManager.getContract(contractName));
|
||||
});
|
||||
|
||||
let plugin = this.plugins.createPlugin('deployment', {});
|
||||
plugin.registerAPICall(
|
||||
'get',
|
||||
'/embark/contract/:contractName',
|
||||
(req, res) => {
|
||||
self.events.request('contracts:contract', req.params.contractName, res.send.bind(res));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
initTracker(cb) {
|
||||
|
|
Loading…
Reference in New Issue