Nodejs Fix Error connect ECONNREFUSED ::1:80 while using localhost
const axios = require("axios")
try {
await axios.get('http://localhost')
} catch (error) {
console.log(error.message)
}
const { setDefaultResultOrder } = require("dns");
setDefaultResultOrder("ipv4first");
try {
await axios.get('http://localhost')
} catch (error) {
console.log(Date.now(), error.message)
}
no comments