After starting the node.js server, does it have to be refreshed before the terminal can have output?

var http = require("http")
var server = http.createServer(function(req,res){
    console.log("hello")
    console.log(2222)
    res.setHeader("Content-Type","text/html","charset=gbk")
    res.write("<h1>jirengu</h1>")
    console.log(__dirname)
    
    res.end()
})
server.listen(8080)

it takes a refresh to output hello 2222 on the terminal. Why?

Feb.27,2021

there must be output only when you visit 8080.


every time you visit the web page code you are listening to, the code


console.log ("hello") is not executed by Synchronize. It will be executed only if the corresponding event is triggered, such as a request.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4601e-438b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4601e-438b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?