如果我在幻像对象中向它传递一个公共 url,但我想传入从另一条路由呈现的内容,我就可以让这条路由工作。这可能吗?
app.route('/pdfreport')
.get(function (req, res) {
var request = require('request');
request('/about/employers', function (error, response, body) {
if (!error && response.statusCode == 200) {
var client = require("jsreport-client")('jsreportsever', 'usernamem', 'password')
client.render({
template: {
content: body,
phantom: {
orientation: "portrait",
width: "300px"
}
}
},function(err, response) {
if (err) {
return next(err);
}
response.pipe(res);
});
}
})
});