Node js复习(1)----简单的Node服务器搭建

1、回顾了new Date().getFullYear() 方法返回年份 如2019。

2、http模块引入 http.createServer(function(req, res){}).listen()

res.write()

res.end()

req.url//地址栏请求路径

可以通过判断req.url是什么返回什么页面

fs.readFIle(patch,(err, data) =>{})

res.write(data) 直接返回读取到的文件

3、url模块和querystring模块

  获取post数据

 

 4、adduser login publish who am i几个发布命令

posted @ 2019-05-09 18:40  document_yx  阅读(127)  评论(0)    收藏  举报