node.js概述
node.js是什么
一个js的运行环境,存在的意义就是让服务器端运行js语言。
node.js的优点
能够处理高并发的http请求,并且由于node是事件驱动的,因此可以节约服务器的内存资源。
使用node创建简单的服务器
var http=require("http"); http.createServer(function (req,res) { res.writeHead(200,{'content-Type':'text/plain'}); res.end("sasasa"); }).listen(1377,"127.0.0.1")