0
我新的網絡掛接,並試圖找出如何接收一個JSON對象並將其保存到Parse.com發佈JSON的網絡掛接上Parse.com
這裏就是我的Express.js網絡掛接的樣子:
// These two lines are required to initialize Express in Cloud Code.
var express = require('express');
var app = express();
// Global app configuration section
app.set('views', 'cloud/views'); // Specify the folder to find templates
app.set('view engine', 'ejs'); // Set the template engine
app.use(express.bodyParser()); // Middleware for reading request body
app.post('/notify_message',
// express.basicAuth('', ''),
function(data) {
// Use Parse JavaScript SDK to create a new message and save it.
var Kenpom = Parse.Object.extend("Kenpom");
var kenpom = new Kenpom();
kenpom.save({
conference : data.results,
}).then(function(kenpom) {
res.send('Success');
}, function(error) {
res.status(500);
res.send('Error');
});
});
// Attach the Express app to Cloud Code.
app.listen();
這是越來越發送到網絡掛接JSON對象:
{
"name": "REST",
"count": 351,
"frequency": "Every 15 mins",
"version": 198,
"newdata": false,
"lastrunstatus": "success",
"lastsuccess": "Tue Mar 03 2015 02:41:02 GMT+0000 (UTC)",
"thisversionstatus": "success",
"nextrun": "Tue Mar 03 2015 03:29:21 GMT+0000 (UTC)",
"thisversionrun": "Tue Mar 03 2015 02:41:02 GMT+0000 (UTC)",
"results": {
"collection1": [
{
"rank": "1",
"team": {
"href": "http://kenpom.com/team.php?team=Kentucky",
"text": "Kentucky"
},
"conference": {
"href": "http://kenpom.com/conf.php?c=SEC",
"text": "SEC"
},
"currentrecord": "29-0",
"pyth": ".9790",
"offensiveefficiency": "118.7",
"defensiveefficiency": "84.9",
"tempo": "63.6"
},
{
"rank": "2",
"team": {
"href": "http://kenpom.com/team.php?team=Arizona",
"text": "Arizona"
},
"conference": {
"href": "http://kenpom.com/conf.php?c=P12",
"text": "P12"
},
"currentrecord": "26-3",
"pyth": ".9649",
"offensiveefficiency": "115.8",
"defensiveefficiency": "86.8",
"tempo": "66.6"
}, ....
Parse.com正在接收所有列,但我看到在解析對象就是:{}
這個數據來自KimonoLabs.com嗎?我試圖使用Parse.com來webhook來自KimonoLabs的數據。我不知道如何提供從Parse到KimonoLabs的webhook網址。 – 2015-10-25 03:58:23