node hello world
Posted webmc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了node hello world相关的知识,希望对你有一定的参考价值。
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 hello world的主要内容,如果未能解决你的问题,请参考以下文章