hi, i’m trying to do some simple api server but the api seems to be accessible only from Chrome, i tried using Firefox, postman or the ‘ping’ commnad from the terminal both return
“The requested URL can’t be reached
The service might be temporarily down or it may have moved permanently to a new web address.
getaddrinfo ENOTFOUND messy-responsible-goat.glitch.me”,
am i missing some configuration?
here is the code i’m using
import express from "express";
// Create instances
const app = express();
const port = 3000;
// Middleware to parse JSON bodies
app.use(express.json());
app.get('/', async (req, res) => {
res.status(200).send('ok');
})
// Start the server
app.listen(port, () => {
console.log(`Server is running on http://localhost:${port}`);
});
I’m able to both visit the url and curl it, maybe try restarting your PC or idk?
tiago@tiago:~$ curl messy-responsible-goat.glitch.me
ok 2
tiago@tiago:~$ ping messy-responsible-goat.glitch.me
PING messy-responsible-goat.glitch.me (xxxx) xx(xx) bytes of data.
xx bytes from xxxx.compute-1.amazonaws.com (xxxx): icmp_seq=x ttl=xx time=xx ms
xx bytes from xxxx.compute-1.amazonaws.com (xxxx): icmp_seq=x ttl=xx time=xx ms
...
It sounds like a DNS issue to me (a non-expert). I eould guess that whatever dns provider your system is using by default is taking a while to propagate, but chrome is using a different one that’s fine? Maybe try looking up how to change dns settings?
How about older glitch projects - like glitch-hello-node.glitch.me?
(this is all speculation by the way)
it should be a dns problem but the thing is, why it works only in chrome? if it is a dns problem i shouldn’t be able to access it at all, i tried with the project you linked and again it works only in chrome, i even tried using several dns like google and cloudflare
Chrome is under no obligation to use your system’s default DNS - as it sounds like you’ve discovered? Or was it your system DNS you tried changing?
For me, I couldn’t load any glitch website (including this forum) if I used clouflare (1.1.1.1) which is bizarre but backs up the theory.
If you have tried changing your system dns to no avail then we may need to construct a new working theory. But the whole thing is very strange!
Is it possible that you’re using a vpn in chrome but not elsewhere, or vice versa?
Found the issue with firefox, it was not using dns over https, i had to enable it and now it works but it still not work anywhere else other then chrome