Try to search your question here, if you can't find : Ask Any Question Now ?

When listening to server, it says server is not defined. Is there another way to listen to a server?

HomeCategory: stackoverflowWhen listening to server, it says server is not defined. Is there another way to listen to a server?
Avatarcraig asked 5 months ago

I’m setting up a new server in Node.js, and the terminal keeps on saying Reference Error: server is not defined. Is there another way to setup a server? Or is there a syntax error?

const http = require('http');

http.createServer((req, res) => {
    console.log(req)
});

server.listen(3000);
1 Answers
Best Answer
Avatarnaveen answered 5 months ago
Your Answer

6 + 0 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com