【发布时间】:2018-02-17 16:52:28
【问题描述】:
基本上,我在本地服务器 (http://localhost:3000/) 上工作,它接收来自另一台服务器的发布请求,如下所示:
return requestLib.post({
url: 'http://localhost:3000/test',
timeout: 120000,
json: true,
body: {
user: user,
proposal: proposal
}
});
并且我想在我的本地服务器上使用来自这个 post 请求的 json 来为从这个 post 请求接收到的 json 创建视图。这是我目前在本地服务器上的 routes.js 文件中所做的事情:
app.post('/test', function(req, res) {
res.render('index', req.body);
res.end();
});
我的问题是如何在我的控制器和本地服务器上的视图中使用这个作为范围接收的 json?我对角度和节点非常陌生,如果这是一个愚蠢的问题/没有意义,您可能会说很抱歉
【问题讨论】:
标签: javascript angularjs node.js express post