vscodehtml环境配置_vscode怎么配置node?

Nodejs是一个让JavaScript运行在服务端的开发平台,可用于方便地搭建响应速度快、易于扩展的网络应用。Node使用事件驱动,非阻塞I/O模型而得以轻量和高效,非常适合在分布式设备上运行数据密集型的实时应用。

6f4e2d83a56bac7409aff8b729efe496.png

Visual Studio Code搭建NodeJs的开发环境

1、下载安装NodeJs并配置环境变量

2、下载安装 VS Code编辑器

3、vscode配置nodejs调试环境侧边栏 调试按钮 添加 nodejs 配置 launch.json

编写 launch.json 配置文件// nodemon 配置

{

"version": "0.2.0",

"configurations": [

{

"type": "node",

"request": "launch",

"name": "nodemon",

"runtimeExecutable": "nodemon",

"program": "${workspaceFolder}\\server\\bin\\www",

"restart": true,

"console": "integratedTerminal",

"internalConsoleOptions": "neverOpen"

}

]

}

运行项目调试服务 添加断点 查看数据传值

4、调试

创建Hello word Demo

08f0b7f663a8719cf5dec11676d5ddf1.png

创建测试服务器server.jsvar http=require('http');

http.createServer(function(req,res){

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

res.end('hello node.js');

}).listen(3000,'localhost',function(){

console.log('Server running at http://localhost:3000');

});

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值