首页 > 其他 > 详细

node

时间:2020-06-23 19:12:43      阅读:68      评论:0      收藏:0      [点我收藏+]

1. node.js的安装

2. 服务端与客户端

意思就是js文件是在客户端环境运行(在浏览器中打开)还是在服务端环境(直接终端运行命令 node index.js)运行

3.1 nodejs原生服务器

const http = require("http")
const server = http.createServer((req, res) => {
    res.write("使用node启动一个服务器")
    res.end()
})

server.listen(3000)

 

node

原文:https://www.cnblogs.com/shun1015/p/13183766.html

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