forward.js 622 Bytes
/**
 * 连接内容返回
 * @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
 * @date: 2018/01/4
 */
'use strict';

const request = require('request-promise');

const miniapp = (req, res) => {
    return request({
        baseUrl: global.yoho.config.domains.api,
        uri: 'wechat/miniapp/img-check.jpg',
        qs: req.query,
        headers: {
            'X-request-ID': req.reqID || '',
            'X-YOHO-IP': req.yoho.clientIp || '',
            'X-Forwarded-For': req.yoho.clientIp || '',
            'User-Agent': 'yoho/nodejs'
        }
    }).pipe(res); // eslint-disable-line
};

module.exports = {
    miniapp
};