We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
localhost
1 parent 1d00b12 commit 3dbbdebCopy full SHA for 3dbbdeb
1 file changed
front-end/src/index.js
@@ -14,7 +14,9 @@ const IpForm = () => {
14
async function checkURL(ipAddress, port) {
15
try {
16
setCheckingURL(true);
17
- const isIPv4 = /^(\d{1,3}\.){3}\d{1,3}$/.test(ipAddress);
+ const isIPv4 = ipAddress !== "localhost" ? /^(\d{1,3}\.){3}\d{1,3}$/.test(ipAddress) : "localhost";
18
+
19
+ // console.log(`http://${isIPv4 ? ipAddress : `[${ipAddress}]`}:${port}/ping`);
20
const response = await fetch(`http://${isIPv4 ? ipAddress : `[${ipAddress}]`}:${port}/ping`);
21
setCheckingURL(false);
22
if (response.ok) {
0 commit comments