mirror of
https://github.com/MailHops/mailhops-node.git
synced 2025-05-15 11:20:12 -07:00
24 lines
726 B
JavaScript
24 lines
726 B
JavaScript
var _ = require("lodash");
|
|
var api = require([__dirname, "lib", "api"].join("/"));
|
|
|
|
function MailHops(config){
|
|
this.configure(config || {});
|
|
}
|
|
|
|
MailHops.prototype.configure = function(config){
|
|
this.base_uri = config.base_uri || 'https://api.mailhops.com';
|
|
this.api_key = config.api_key || undefined;
|
|
this.proxy = config.proxy || undefined;
|
|
this.api_version = config.api_version || 2;
|
|
this.api_version = ["v", this.api_version].join("");
|
|
this.app_name = config.app_name;
|
|
this.forecastio_api_key = config.forecastio_api_key || undefined;
|
|
this.show_client = config.show_client || 1;
|
|
}
|
|
|
|
_.each(api, function(method, name){
|
|
MailHops.prototype[name] = method;
|
|
});
|
|
|
|
module.exports = MailHops;
|