faceookのapiはものによってはhttps通信じゃないと行けないみたいなのでhttpsをrequireします.
facebookはグループのAPIです.アクセストークンを使います.
routs/index.js
var https = require('https');
var url = 'https://graph.facebook.com/(グループのID)/feed?access_token=(アクセストークン)';
var response = https.get(url, function(res){
var body = '';
res.setEncoding('utf8');
res.on('data', function(chunk){
body += chunk; //console.log(body);←元データ
});
res.on('end', function(res){
ret = JSON.parse(body);
response = ret.data;
//console.log(response);
});
}).on('error', function(e){
console.log(e.message); //エラー時
});
exports.index = function(req, res){
console.log(response);
res.render('index', { title: 'Express', data: response});
};
これでdataの中身をviewで利用することが出来ました.