Node.js project - successful server listening but webpage does not load

Question:

I have a Node.js project with the following files: index.html, styles.css, script.js, index.js. When I hit the green “Run” button, the terminal shows a message that says “Server listening at http://localhost:3000”. However, in the Webview nothing is loading. When I click the “New Tab” button, it brings me to an error page that says " This site can’t be reached".

Repl link:

code snippet

Hi @ChaninderRishi2 , welcome to the forums!
What is the url that you encounter when you open the repl in a new tab? If it ends with repl.co, try changing repl.co to replit.dev.
Hope this helps!

It should be listening at 0.0.0.0:3000, try to see if that fixes your issue.

2 Likes