mirror of https://github.com/embarklabs/embark.git
add api registration to plugin
This commit is contained in:
parent
bf4758494e
commit
ad7b0fc74e
|
@ -35,6 +35,7 @@ var Plugin = function(options) {
|
||||||
this.logger = this._loggerObject; // Might get changed if we do intercept
|
this.logger = this._loggerObject; // Might get changed if we do intercept
|
||||||
this.events = options.events;
|
this.events = options.events;
|
||||||
this.config = options.config;
|
this.config = options.config;
|
||||||
|
this.plugins = options.plugins;
|
||||||
this.env = options.env;
|
this.env = options.env;
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.currentContext = options.context;
|
this.currentContext = options.context;
|
||||||
|
@ -229,6 +230,11 @@ Plugin.prototype.registerAPICall = function(method, endpoint, cb) {
|
||||||
this.pluginTypes.push('apiCalls');
|
this.pluginTypes.push('apiCalls');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Plugin.prototype.registerAPICall = function(method, endpoint, cb) {
|
||||||
|
this.apiCalls.push({method: method, endpoint: endpoint, cb: cb});
|
||||||
|
this.pluginTypes.push('apiCalls');
|
||||||
|
};
|
||||||
|
|
||||||
Plugin.prototype.runFilePipeline = function() {
|
Plugin.prototype.runFilePipeline = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue