如何在Node上使用Express.js从Instagram API接收文章

我试图设置一个应用程序,将实时显示Instagrampost与一个特定的主题标签。

这是我到目前为止。

var io = require('socket.io').listen(app) , fs = require('fs') , connect = require('connect') , $ = require('jquery') // , ngrok = require('ngrok') , express = require('express') , app = express() , port = process.env.PORT || 5000; //ngrok.connect(5000, function (err, url) { //}) app.listen(port); function handler (req, res) { fs.readFile(__dirname + '/index.html', function (err, data) { if (err) { res.writeHead(500); return res.end('Error loading index.html'); } res.writeHead(200); res.end(data); }); } io.sockets.on('connection', function (socket) { socket.emit('news', { hello: 'world' }); socket.emit('stuff', function() { console.log("http server listening on %d", port); }); socket.on('my other event', function (data) { console.log(data); }); }); // Defining Routes app.use(express.static(process.cwd() + '/public')); app.get('/', function (req, res) { res.send('Testing'); }); app.get('/endpoint', function (req, res) { // For convention's sake, we only respond to this if it's a properly formatted request from Instagram if (req.query['hub.challenge']) { // First we check if hub.challenge exists in the query, then we do something res.send(req.query['hub.challenge']); } }); 

这是我错了/丢失的地方

 app.use(express.bodyParser()); app.post('/endpoint', function (req, res) { console.log(req.body); }); 

我相信我已经遵循Instagram API中的Subscription教程(设置hub.challenge并设置了订阅),但是如何查看它应该发送的传入JSON数据? 最重要的是,我如何操作JSON来显示前端的图片?

任何帮助表示赞赏!