您的位置:首页 > Web前端 > Node.js

nodejs初探(二)第一个nodejs程序“hello world”

2015-12-12 11:02 615 查看
直接用文本编辑器编写helloworld.js,保存在桌面

var http = require("http");
http.createServer(function(request, response) {
response.write("Hello World");
response.end();
}).listen(8080);
console.log("nodejs start listen 8080 port!");


  


在浏览器中访问http://localhost:8088/

会看到显示

Hello World
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: