I’m watching a tutorial for node.js and using this code
const http = require("http")
const port = 8080
const server = http.createServer(function(req, res){
res.write("Hello node")
res.end
})
server.listen(port, function(error){
if(error){
console.log("Something went wrong", error)
}else{
console.log("Server is listening on port " + port)
}
})
When running it, I’m getting
But when I try http://localhost:8080 its loading infinitely. Anyone know why?