码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-12-12 12:36:12      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

直接用文本编辑器编写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

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

标签:

原文地址:http://www.cnblogs.com/lixiaoran/p/5040937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!