node.js
ZainYzy
这个作者很懒,什么都没留下…
展开
-
如何计算JSON对象中的子项数目
var count = Object.keys(results).length;count = count.toString()console.log(count);原创 2021-08-31 22:20:44 · 464 阅读 · 0 评论 -
NodeJS解决跨域问题:Access-Control-Allow-Origin
解决办法:响应报文头加个"Access-Control-Allow-Origin": "*",res.writeHead(200,'ok',{ "Access-Control-Allow-Origin": "*", 'Content-Type':'application/json; charset = utf8' })原创 2021-08-31 22:18:51 · 845 阅读 · 0 评论 -
Node连接mySQL:Cannot enqueue Handshake after already enqueuing a Handshake.
解决办法:使用池连接Pooling connectionshttps://www.npmjs.com/package/mysqlRather than creating and managing connections one-by-one, this module also provides built-in connection pooling using mysql.createPool(config). Read more about connection pooling.Creat原创 2021-08-31 22:17:16 · 630 阅读 · 0 评论