const http = require('http')
const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/plain')
console.log('Incoming')
res.write("Hello world, request granted!")
res.end()
})
server.listen(3000, 'localhost', () => {
console.log("Listening for requests on port 3000")
})
Whenever I start the server, it says "Listening for requests on port 3000", thats correct. But when I open the localhost:3000 on Chrome, it puts out "Incoming" TWO TIMES. Why two times? :D I don't get it.