我想使用nodejs通过fb api检索我的fb帖子,同时这样做会导致以下错误..有人可以帮助我吗?
我尝试过“ facebook-node-sdk” 请提出如何从fb检索数据的建议。由于是新手,我确实知道正确的方法。
import express from 'express';
import axios from 'axios';
const router = express.Router();
const app = require('express')();
var Facebook = require('facebook-node-sdk');
var facebook = new Facebook({ appID: 'appid', secret: 'secretid' });
router.get('/facebook', (req, res) => {
let url = "http://graph.facebook.com/v3.3/me?&access_token=myaccesstoken";
facebook.api(url, function(err, data){
if(err){
console.log(err);
}
else{
res.json({
statusCode: 200,
status: "Success1",
result: data,
message:"fb data"
})
//Do some stuff with the data object
}
});
});