对node完全陌生.js环境与哲学我想回答几个问题.我已经下载了 node .js适用于windows installer,也适用于 node 包管理器.Windows Cmd提示符当前正用于运行nodejs应用程序.
cls清除命令窗口或命令提示符中的错误.node是否有一个类似功能.js?安慰明确不存在;(还是以其他形式?
-
我通过下面的代码创建了一个服务器
var http = require("http"); http.createServer(function (request, response) { response.writeHead(200, { "Content-Type": "text/html" }); response.write("Hello World"); console.log("welcome world")response.end(); }).listen(9000, "127.0.0.1");
我将代码更改为下面的代码,并刷新浏览器,发现内容类型没有更改,如何查看更改?
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
console.log("welcome world")
response.end();
}).listen(9000,"127.0.0.1");