Basic Node and Express - Start a Working Express Server

Tell us what’s happening:

Describe your issue in detail here.

// running tests
Your app should serve the string 'Hello Express'
// tests completed
// console output
[Error: Not Found]

Your project link(s)

http://localhost:3000

solution:

let express = require('express');
let app = express();
console.log("Hello World");
app.get("/",(req,res)=>{
    res.json("Hello Express");
})

Your browser information:

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

Challenge Information:

Basic Node and Express - Start a Working Express Server

Please note you’re server is running on your computer when typing npm start in command prompt in Windows. It is not a constant live version on a server. The exercise must be running live to be tested by freeCodeCamp to pass test when link is pasted in solution link.
Rather download replit version and follow instructions on freeCodeCamp.
Meet the Node console.
Remember to copy you’re live link from New Tab in replit window and pastein Solution Link on freeCodeCamp Back End Development and APIs Meet the Node console.

I know this is an old thread but if the code you posted is all the code you have you are missing the export at the bottom of the file.

let express = require('express');
let app = express();
console.log("Hello World");
app.get("/",(req,res)=>{
    res.json("Hello Express");
})

module.exports = app;

You should be using res.send and not res.json when sending plain strings, but the challenge tests do not care as far as I can tell. Later backend challenges might though just so you are aware of it.

As said, the server should be running.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.