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

node.js初步使用

2017-05-27 07:41 267 查看
node.js  中文网 :http://nodejs.cn  下载node  windows情况下自带npm  而如果是Linux的情况下 需要自己去下载npm

安装过程 一路next即可   最后配置下环境变量 NODE_PATH     :   你安装node的路径       node安装配置成功

var http=require('http');

http.createServer(function (request,response){

    response.writeHead(200,{'Content-Type':'text/plain'})

    response.end("hello,world\n");

    }).listen(8000);

    

console.log('Server runing at http://127.0.0.1:8000'); 
页面上输入 localhost:8000

即可看到输出helloworld 

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