Express + Axios - 管道请求到另一台服务器

时间:2021-03-22 17:50:36

标签: express axios

使用 express 和 request,将请求传送到另一台服务器并响应它的响应就像

router.get('/', (req, res, next) => {
    req
        .pipe(request.get(`https://some_url/${req.path}`))
        .pipe(res);
}

使用 axios 的等价物是什么?简单地用 axios 替换请求结果

<块引用>

(node:17672) UnhandledPromiseRejectionWarning: TypeError: dest.on is 不是函数

0 个答案:

没有答案