Skip to content

Instantly share code, notes, and snippets.

@JBreit
Created November 26, 2015 00:16
Show Gist options
  • Save JBreit/8fa445ab15d6ada96fd1 to your computer and use it in GitHub Desktop.
Save JBreit/8fa445ab15d6ada96fd1 to your computer and use it in GitHub Desktop.
var os = require('os'),
cluster = require('cluster'),
express = require('express'),
app = express(),
http = require('http'),
server = http.createServer(app),
logger = require('winston');
var System = function () {
'use strict';
this.name = os.hostname();
this.platform = os.platform();
this.type = os.type();
this.release = os.release();
this.arch = os.arch();
this.upTime = os.uptime();
this.loadAvg = os.loadavg();
this.cpus = os.CPUs();
this.freeMemory = os.freemem();
this.totalMemory = os.totalmem();
this.networkInterfaces = os.networkInterfaces();
};
/*function System () {
'use strict';
};*/
System.prototype = {
init: function () {
'use strict';
logger.info('Starting initialization sequence...');
},
config: function (options) {
'use strict';
},
serve: function (port, host) {
'use strict';
server.listen(port, host, function () {
logger.info('Listening at ' + host + ' on port ' + port);
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment