首页 > Web开发 > 详细

node.js(一)

时间:2020-06-08 15:00:56      阅读:42      评论:0      收藏:0      [点我收藏+]

安装node.js

node.js创建应用

新建server.js

 1 const http = require(‘http‘)
 2 
 3 http.createServer((Request, Response) => {
 4     Response.writeHead(200, {
 5         ‘Content-Type‘: ‘text/plain‘
 6     })
 7     Response.end(‘hello word‘)
 8 }).listen(9999)
 9 
10 console.log(‘Server running at http://192.168.1.113:9999/‘)

node执行以上代码

node server.js

打开浏览器访问,就会看到如下

技术分享图片

node.js(一)

原文:https://www.cnblogs.com/dropInInt/p/13065544.html

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