Hi - I have writen some lines of nodejs code here
https://glitch.com/~sag-one
As far as I understand, my clients have to come to my APP by those URLs :
https://sag-one.glitch.me/ or */dreams
Unfortunatelly, when I open a browser to any of those URLs, the browser stays … “Starting”
My log has a last line indicating the listener did start :
Your app is listening on port 9877
What am I missing ?
Yes, I am new to glitch, but not to nodejs
Thanks
Can you look for the line of code that says something like listen(port)? You should set that to 3000.
I have set PORT to 9877 in “.env”
Is it mandatory to have port = 3000 ?
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});
On Glitch I believe that you need to set the port to 3000.
let me try
I change the value in “.env” but the message in “log” with new PORT does not come up
How do I do to re-start the APP ?
I have watch.json installed …
yes, port = 3000 works OK
can you provide any pointer, url or documentation where it says that value is mandatory ?
Thanks, anyway, thanks a lot
I did a but of digging and i couldn’t find anywhere that an admin explicitly said that port 3000 was the only working port, I just know its the only working port from conversations I’ve viewed while on the forum. However, I found this article on the help center that says 3000 is the default port.
https://glitch.happyfox.com/kb/article/30-what-environment-variables-are-available-in-a-project/
Thanks a lot - you know the very firsts projects are the most difficult … !
2 Likes