码迷,mamicode.com
首页 > 其他好文 > 详细

Node个人学习(一)----express

时间:2017-05-07 21:11:59      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:strong   lin   height   expr   post   res   监听   logs   javascrip   

express的功能:

//1.创建服务
var server=express();

//2.监听
server.listen(8080);


//3.处理请求(三种方法) //express保留了原生的功能,添加了一些方法(send),增强原有的功能
.get(‘/‘, function (req, res){
res.write("123")/res.send("123"); ----相对于write而言,send的适用性更好,不易出错
res.end();
});
.post(‘/‘, function (req, res){});
.use(‘/‘, function (req, res){});

  

Node个人学习(一)----express

标签:strong   lin   height   expr   post   res   监听   logs   javascrip   

原文地址:http://www.cnblogs.com/goodxiao/p/6822148.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!