proxy.js
358 Bytes
/**
* controller 入口
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/04/13
*/
const Api = require('../common/api');
module.exports = (req, res, next) => {
let api = new Api();
api.setContext({
req,
res
});
return api.post(req.originalUrl, req.body).then(data => {
res.json(data);
}).catch(next);
};