Skip to content

Commit

Permalink
make HFTSite able to change options after initialziation
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Nov 22, 2014
1 parent f3c349b commit fb670db
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions server/hftsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,25 @@ var inform = function() {
}
};

/**
* @typedef {Object} HFTSite~Options
* @property {string?} address ip address eg. "1.2.3.4"
* @property {string?} port port eg "18679"
* @property {boolean?} privateServer true = don't send info to hftsite
*/

/**
* Set options for hftSize
*
* @param {HFTSite~Options} options
*/
var setup = function(options) {
g.address = options.address;
g.port = options.port;
g.privateServer = options.privateServer;
["address", "port", "privateServer"].forEach(function(key) {
var value = options[key];
if (value !== undefined) {
g[key] = value;
}
});
};

exports.inform = inform;
Expand Down

0 comments on commit fb670db

Please sign in to comment.