I'm a beginner with Node.js.
I have just installed node JS, and I'm trying to create and execute code through a local server (for practice purposes). But it can't be possible to execute the code using localhost:8080 on a web browser nor through the cmd (I'm on windows 7).
Below you can see what I've been trying so far...
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World! i did it');
}).listen(8080);
The browser just says that the site can't be reached and the cmd shows nothing after executing the command. So what would be the problem.