如何在服务器端的node.js中将变量中保存的文本显示在html中。
换言之,为了更加清晰明了,我从访问Twitter(Twitt)的API中获取了输出,现在我正在尝试将该文本显示在页面底部。
以下是网页的调用方式:
app.get('/', function (req, res) {
res.sendfile('./Homepage.html');
});
这是调用Node.js文件的位置:
var express = require('express');
var app = express();
这就是变量的位置:
T.get('search/tweets', { q: hash1 + ' since:2013-11-11', count: 5 },
function(err, reply) {
response = (reply),
console.log(response)
app.append(response)
})