![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
node
骚年008
靠山山倒,靠人人倒!
使用最小代价,创造最大收益。
展开
-
node获取任意文件的路径
var fs = require('fs'); // 获取路径下的所有文件 function getRoute(path) { // 定义一个对象 let obj = {}; // 读取文件,返回一个对象 let resDir = fs.readdirSync(path); // 循环遍历对象 for (let i in resDir) { ...原创 2018-07-16 19:14:32 · 2363 阅读 · 0 评论 -
正向代理和http
什么是正向代理? 客户端为了取得原服务端的内容,客户端向代理发送一个请求指向原服务端,然后代理向原始服务器转交请求并将获得的内容返回给客户端。 http的get请求 const https = require('https'); const fs = require('fs'); https.request({ method:'get', hostname:'api.do...原创 2018-07-19 19:16:44 · 885 阅读 · 0 评论