如何设置 Web 应用程序以与 Parse Server 通信 (JavaScript)

How to set up web app to talk to Parse Server (JavaScript)

我在 AWS 上有 Parse Server 运行,我想知道如何将对象保存到它。我不确定如何在我的 javascript 文件中连接到 Parse Server...

我会做类似的事情吗:

var Parse = require('parse');

Parse.initialize("YOUR_APP_ID");

Parse.serverURL = 'http://mypath'

此外,如何在我的 js 文件中包含 Parse SDK?

成功了!

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://npmcdn.com/parse/dist/parse.min.js"></script>
<script>
    Parse.initialize("518e0dbca14e73748f81e550e12deea515ff959e");
    Parse.serverURL = 'http://ec2-35-165-199-91.us-west-2.compute.amazonaws.com:80/parse';
    var GameScore = Parse.Object.extend("GameScore");
    var gameScore = new GameScore();
    gameScore.save({playerName: "Kir"}).then(function(object) {
        alert("yay! it worked");
    });
</script>
</head>
<body>
</body>
</html>