Basic Node and Express - Meet the Node console

Tell us what’s happening:

I have cloned the code locally and app.js is showing hello world in terminal but how can i share the code with FreeCodeCamp. If i am doing localhost it doesn’t show anything as we are only showing in console not on the page and i am unable to solve this challenge.

###Your project link(s)

solution: http://localhost:5000

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Basic Node and Express - Meet the Node console

did you change the default port? it’s usually served on port 3000

if the port is right, the other thing is restarting the server after making changes, which if you see the log in the terminal you did

lastly, can you share your code?

I have this code in app.js file and it shows hello world in terminal and Welcome on page

let express = require(‘express’);

let app = express();

console.log(‘Hello World’);

app.get(‘/’, (req, res) => {

res.send(‘Welcome!’);

});

app.listen(5000, () => { console.log(‘Server running on http://localhost:5000’) });

that doesn’t look like the code in the given repo, where does this come from?

there was only two top lines express require one and other app where you creating instance of express. I added the other code to display hello world to display in console and also i added the localhost 5000.If I should not be doing this then how i should solve this challenge?

the server is started in server.js, on port 3000

please remove app.get and app.listen and if you have removed it restore the export

1 Like

I got the issue. I wasn’t supposed to create a localhost ,it was already running from freeCodeCamp. As soon as I deleted my localhost code and app.get(…) code ,i passed the challenge.