Javascript 无法在nodeJS中保存Parse.Object
在解析云代码NodeJS中。我使用Javascript 无法在nodeJS中保存Parse.Object,javascript,node.js,parse-server,Javascript,Node.js,Parse Server,在解析云代码NodeJS中。我使用Parse.object创建了一个新对象,但无法保存它。我犯了这样一个错误: ParseError { code: 107, message: 'Received an error with invalid JSON from Parse: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Erro
Parse.object
创建了一个新对象,但无法保存它。我犯了这样一个错误:
ParseError {
code: 107,
message: 'Received an error with invalid JSON from Parse: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /classes/GameScore</pre>\n</body>\n'
}
你有没有想过@路易丝,你有没有想过@路易斯
var Parse = require("parse/node")
Parse.Cloud.define("newGameScore", function (req, res) {
var GameScore = Parse.Object.extend("GameScore");
var gameScore = new GameScore();
gameScore.set("score", 1337);
gameScore.set("playerName", "Sean Plott");
gameScore.set("cheatMode", false);
gameScore.save({useMasterKey: true}, {
success: function (gameScore) {
// Execute any logic that should take place after the object is saved.
console.log("Awesome");
alert('New object created with objectId: ' + gameScore.id);
},
error: function (gameScore, error) {
console.log(error);
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
}
});
})