Commit 5f5a06b2 authored by tywldx's avatar tywldx

temp

parent 464a760a
......@@ -41,7 +41,7 @@ if(env == "debug"){
}
vhost[ip] = 'blackPearl';
vhost["bp.q-gp.com"] = 'blackPearl';
vhost["bp.xrtai.com"] = 'blackPearl';
let path = {
// project
project: './app/',
......@@ -53,8 +53,8 @@ let path = {
path.default_path[ip] = "/home/index";
path.default_jump[ip] = true;
path.default_path["bp.q-gp.com"] = "/home/index";
path.default_jump["bp.q-gp.com"] = true;
path.default_path["bp.xrtai.com"] = "/home/index";
path.default_jump["bp.xrtai.com"] = true;
module.exports = makeConfig({
......
......@@ -18,32 +18,32 @@ const debug = require('debug')('app.js');
var os = require('os');
var ifaces = os.networkInterfaces();
let ip = "0.0.0.0";
function getIp() {
Object.keys(ifaces).forEach(function (ifname) {
var alias = 0;
ifaces[ifname].forEach(function (iface) {
if ('IPv4' !== iface.family || iface.internal !== false) {
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
return;
}
if (alias >= 1) {
// this single interface has multiple ipv4 addresses
// console.log(ifname + ':' + alias, iface.address);
} else {
// this interface has only one ipv4 adress
console.log(ifname,iface.address)
if (ifname == "eth0" || ifname == "en0") {
ip = iface.address;
}
// console.log(ifname, iface.address);
}
++alias;
});
});
}
getIp();
// let ip = "0.0.0.0";
// function getIp() {
// Object.keys(ifaces).forEach(function (ifname) {
// var alias = 0;
// ifaces[ifname].forEach(function (iface) {
// if ('IPv4' !== iface.family || iface.internal !== false) {
// // skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
// return;
// }
// if (alias >= 1) {
// // this single interface has multiple ipv4 addresses
// // console.log(ifname + ':' + alias, iface.address);
// } else {
// // this interface has only one ipv4 adress
// console.log(ifname,iface.address)
// if (ifname == "eth0" || ifname == "en0") {
// ip = iface.address;
// }
// // console.log(ifname, iface.address);
// }
// ++alias;
// });
// });
// }
// getIp();
function randomString(len) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment