Nodejs入门编写hello world

论坛 期权论坛 脚本     
匿名技术用户   2020-12-23 08:22   11   0

一、安装nodejs

下载:https://nodejs.org/en/download/

二、编写 helloworld.js

//创建web服务器
var http=require('http');
http.createServer(function(request,response){
 response.writeHead(200, {
   'Content-Type': 'text/plain' });
 response.end('hello world');  
}).listen(8888);

三、启动web服务

node helloworld.js

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP