To fix Error: getaddrinfo ENOTFOUND in Node.js for get call, we should make sure the URL is pointing to a valid location.
For instance, we write
const optionsGet = {
host: "localhost",
port: 3010,
path: "/quote/random",
method: "GET",
};
const reqGet = https.request(optionsGet, (res) => {});
to call https.request
with the valid host
and path
to make a get request to https://localhost:3010/quote/random