我正在使用Parse進行一些快速MVP應用程序開發以證明某些概念。一切工作正常,我只是想通過設立一些第三方集成等推廣我們的應用程序的能力自託管分析平臺RESTful API訪問
我想通過REST的API來訪問我的雲碼功能,如記錄here
我已經更改了服務器地址,但沒有運氣連接並拉動數據。
我正在使用Node.js連接到Heroku上託管的REST api。
var options = {
host: 'https://###############.herokuapp.com',
port: 443,
path: '/parse/functions/'+req.param('text'),
method: 'POST',
headers: {
'X-Parse-Application-Id': '##############',
'X-Parse-REST-API-Key': '###########'
}
};
https.get(options, function(resp){
resp.on('data', function(chunk){
//do something with chunk
res.send(chunk)
});
}).on("error", function(e){
console.log("Got error: " + e.message);
res.send(e)
});
到目前爲止沒有運氣。有什麼建議麼?
測試功能您是否收到來自服務器的響應?你還可以在index.js中分享你實例化Parse Server的代碼嗎? – dhallman
沒有足夠的信息來獲得正確答案。請在此處粘貼您的Parse Server配置。 – Haven