![](https://img-blog.csdnimg.cn/20190927151026427.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
NodeJS
nodejs
祈晴小义
good good study, day day up.
展开
-
NodeJS http服务端获取POST请求数据
http服务我们知道,使用nodejs标准库的http模块创建一个http服务很简单,如下:const http = require('http');const hostname = '127.0.0.1';const port = 3000;const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain');原创 2020-06-30 16:09:36 · 12640 阅读 · 2 评论 -
一句话说清楚NodeJS中module.exports和exports的区别
关于这个问题NodeJS的官方文档中有一句很精辟解释:What’s the difference between module.exports and exports?The first exposes the object it points to. The latter exposes the properties of the object it points to.翻译过来就是说,module.exports是直接导出整个对象,而exports导出的是对象中的属性。以下通过两个简单的例子可原创 2020-06-29 15:01:31 · 420 阅读 · 1 评论