Why isn't console.log () in nodejs output on the console?

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)

Why do console.log and console.log ("hello") output on the terminal and not on the console?

clipboard.png

Feb.26,2021

this is the backend code and will not be output in the browser. Look at the terminal started at your backend


this means that
receives a http request on the server = > console.log > http reply
has nothing to do with the browser


node.js is running on the server js, will not be output in the browser.

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-1e753cd-545.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-1e753cd-545.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?