From 69d62271a115691fdbc9b28006a9b80dffe1e526 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Fri, 11 Mar 2022 11:51:26 +0800 Subject: [PATCH] remove base.tool, do not show ipv4 by default --- package.json | 1 - server.js | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index ff2b1a7..cc8f4c9 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "morgan": "^1.9.0", "serve-favicon": "^2.5.0", "base.enviconfig": "git+https://git.faronear.org/npm/base.enviconfig", - "base.tool": "git+https://git.faronear.org/npm/base.tool", "vhost": "^3.0.2" }, "devDependencies": { diff --git a/server.js b/server.js index e3f6caf..5697594 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,5 @@ const fs = require('fs') const path = require('path') -const tool4net = require('base.tool/tool4net.js') const express = require('express') const wo = (global.wo = { @@ -84,7 +83,6 @@ if (typeof wo.envi.ssl === 'string') { /*** 启动 Web 服务 ***/ let webServer - let ipv4 = tool4net.getMyIp() if ('http' === wo.envi.protocol) { let portHttp = wo.envi.port || 80 webServer = require('http') @@ -94,7 +92,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttp} with IPv4=${ipv4} for ${wo.envi.prodev} environment` + `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttp} for ${wo.envi.prodev} environment` ) } }) @@ -115,7 +113,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttps} with IPv4=${ipv4} for ${wo.envi.prodev} environment` + `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttps} for ${wo.envi.prodev} environment` ) } }) @@ -139,7 +137,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server redirecting from http://${wo.envi.host}:${portHttp} with IPv4=${ipv4} for ${ + `[${new Date().toJSON()}] Server redirecting from http://${wo.envi.host}:${portHttp} for ${ wo.envi.prodev } environment` ) @@ -159,7 +157,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server listening on https://${wo.envi.host}:${portHttps} with IPv4=${ipv4} for ${ + `[${new Date().toJSON()}] Server listening on https://${wo.envi.host}:${portHttps} for ${ wo.envi.prodev } environment` ) @@ -177,7 +175,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttp} with IPv4=${ipv4} for ${wo.envi.prodev} environment` + `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttp} for ${wo.envi.prodev} environment` ) } }) @@ -203,7 +201,7 @@ if (typeof wo.envi.ssl === 'string') { console.log(err) } else { console.log( - `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttps} with IPv4=${ipv4} for ${wo.envi.prodev} environment` + `[${new Date().toJSON()}] Server listening on ${wo.envi.protocol}://${wo.envi.host}:${portHttps} for ${wo.envi.prodev} environment` ) } })