13397158231   jevian_ma@worldflying.cn

不到15行---超简单的nodejs的http服务器

2020-09-17 02:34:36

方便大家平时学习使用。

const http = require('http')

http.createServer(function (req, res) {
    let body = ''
    req.on('data', function (data) {
        body += data
    })
    req.on('end', function () {
        console.log(req.method, req.url)
        console.log(body)
        res.end('{"errcode":0}');
    })
}).listen(3000);


文章作者:沃航科技

优秀产品推荐:可编程网络IO控制器

上一篇:esp-12系列烧程序所需参数配置

下一篇:Linux下压缩文件或文件夹为zip文件方法

联系我们

  • 地址:武汉市东湖高新开发区光谷总部国际1栋2412室
  • QQ:932773931
  • 电话:027-59761089-806
  • 手机:13397158231
  • 邮箱:jevian_ma@worldflying.cn

关注公众号

扫码添加微信

沃航(武汉)科技有限公司版权所有

备案号:鄂ICP备16014230号-1

本网站由提供CDN加速/云存储服务