Hello,
I don’t know what is wrong with my code. I see no problem with it, but I keep failing the test. Please help.
let express = require('express');
let app = express();
console.log("Hello World");
app.get("/", (req, res)=>{
res.send("Hello Express");
console.log("Hello Express");
});
console.log("Code After");
module.exports = app;
Teller
December 1, 2025, 7:43pm
3
Hi @jobanibusiness
Try removing the extra console logs, then restart the server.
If that doesn’t work, try using a regular function instead of an arrow function.
Happy coding
1 Like
I have tried this but I receive the same error. Maybe the file path has to be specific?
let express = require('express');
let app = express();
// console.log("Hello World");
app.get("/", function(req, res){
res.send("Hello Express");
});
//console.log("Code After");
module.exports = app;
Does control C then entering Y restart the server or is it another way to do it?
ctrl-c should be entered until you are back on the terminal.
then you should rerun the npm/node command you used to start
1 Like
I seem to only encounter problems when using VS code to complete the tests. Is there another method to submit these tests?
vscode is an editor. You can use any editor you want. The goal is to run the server though, and that doesn’t change.
1 Like
Well I’m stumped. Tried all suggestions but still no success.
hbar1st
December 3, 2025, 3:24pm
10
look at the console output in your browser when you are running the test.
The errors there may indicate the issue
1 Like
My guess is that it has to do with something with the other files and not the myApp.js file itself.
hbar1st
December 4, 2025, 11:57pm
12
look for all occurrences of .use( and see what is happening. Is it possible you messed with the original code given to you? (I assume you didn’t add any that uses use)?
1 Like
For some reason, this line of code was like this in the server.js file I downloaded:
const myApp = require('./myApp').default;
and after comparing it to the one on GitHub I noticed that it didn’t have the default method.
const myApp = require('./myApp');
After I removed it it worked and I got the desired result, but for some reason I am still failing the test.
I made sure to end the server with control + c and starting it up again with npm run start.