Add route to set/get sysinfo

This commit is contained in:
Girish Ramakrishnan
2019-10-29 20:08:45 -07:00
parent 813454ca82
commit 8232d471a3
9 changed files with 97 additions and 10 deletions

View File

@@ -1,7 +1,8 @@
'use strict';
exports = module.exports = {
getServerIp: getServerIp
getServerIp,
testConfig
};
var assert = require('assert'),
@@ -23,3 +24,12 @@ function getServerIp(config, callback) {
return callback(null, addresses[0]);
}
function testConfig(config, callback) {
assert.strictEqual(typeof config, 'object');
assert.strictEqual(typeof callback, 'function');
if (typeof config.ifname !== 'string') return callback(new BoxError(BoxError.BAD_FIELD, 'ifname is not a string'));
callback(null);
}