Deleting all apps apart from those used in Ch1 and Ch2 labs

This commit is contained in:
Ravi Srinivasan
2019-06-07 12:51:10 +05:30
parent 9853abc4ac
commit a387a34d24
213 changed files with 0 additions and 6502 deletions

View File

@@ -1,29 +0,0 @@
var os = require('os');
exports.context = function(server, path) {
if (!server)
done('has to provide a restify server object');
server.get(path + '/host', this.serverInfo);
};
exports.serverInfo = function(req, res, next) {
var address;
var ifaces = os.networkInterfaces();
for (var dev in ifaces) {
var iface = ifaces[dev].filter(function(details) {
return details.family === 'IPv4' && details.internal === false;
});
if (iface.length > 0)
address = iface[0].address;
}
var reply = {
ip: address,
hostname: os.hostname()
};
res.json(reply);
next();
};