首页 > 其他 > 详细

node(1) hello world

时间:2018-08-06 20:47:09      阅读:198      评论:0      收藏:0      [点我收藏+]
 1 //一 使用require指令来载入http模块
 2 var http = require(‘http‘);
 3 //二使用http.createServer()的方法创建服务器
 4 http.createServer(function(request,response){
 5    //发送HTTP头部
 6    //HTTP状态值:200 
 7    //内容类型:text/plain
 8    responsed.writeHead(200,{‘Content-type‘:‘text/plain‘});
 9 
10    //发送响应数据 “Hellow world”
11    response.end(‘hellow world‘);    
12 }).listen(3000,"127.0.0.1");

 

node(1) hello world

原文:https://www.cnblogs.com/webmc/p/9432688.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!