节点服务器未启动(命令执行但未启动端口)?
Node server is not starting(command executes but not start the port)?
当我输入“node server.js”时开始执行,光标停留在下一行的开头,这是什么错误。
const http = require('http');
http.createServer((req, res) => {
console.log("hi from server");
res.end('ok');
}).listen(8000);
如果您添加此行,这实际上是正常行为
console.log("Hi from Server");
之前
res.end("ok");
光标将打印"hi from server"
和return到相同的状态..
const test= http.createServer((re,res)=>{} console.log(test,"hi from server)
当我输入“node server.js”时开始执行,光标停留在下一行的开头,这是什么错误。
const http = require('http');
http.createServer((req, res) => {
console.log("hi from server");
res.end('ok');
}).listen(8000);
如果您添加此行,这实际上是正常行为
console.log("Hi from Server");
之前
res.end("ok");
光标将打印"hi from server"
和return到相同的状态..
const test= http.createServer((re,res)=>{} console.log(test,"hi from server)