Skip to content

Commit

Permalink
Add a link that opens up a javascript prompt to allow you to use a di…
Browse files Browse the repository at this point in the history
…fferent app id than myAppId if you want (#282)
  • Loading branch information
AndrewLane authored and flovilmart committed Jun 12, 2018
1 parent e414422 commit 19f5ce6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ XHR.setCallback = function(callback, failureCallback) {
XHR.POST = function(path, callback) {
var seed = {"score":1337,"playerName":"Sean Plott","cheatMode":false}
this.xhttp.open("POST", Config.getUrl() + path, true);
this.xhttp.setRequestHeader("X-Parse-Application-Id", "myAppId");
this.xhttp.setRequestHeader("X-Parse-Application-Id", $('#appId').val());
this.xhttp.setRequestHeader("Content-type", "application/json");
this.xhttp.send(JSON.stringify(seed));
}

XHR.GET = function(path, callback) {
this.xhttp.open("GET", Config.getUrl() + path + '/' + Store.objectId, true);
this.xhttp.setRequestHeader("X-Parse-Application-Id", "myAppId");
this.xhttp.setRequestHeader("X-Parse-Application-Id", $('#appId').val());
this.xhttp.setRequestHeader("Content-type", "application/json");
this.xhttp.send(null);
}
Expand Down
4 changes: 4 additions & 0 deletions public/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

<p class="up-and-running">Looks like our local Parse Serve is running under <span id="parse-url">...</span>. Let’s test it?
</p>

<p>We'll use an app id of "myAppId" to connect to Parse Server. Or, you can
<a href="javascript: var newAppId = prompt('What app id should we use to talk to Parse Server?'); if (newAppId) { $('#appId').val(newAppId); }">change it</a>.

<p>We have an express server with Parse server running on top of it connected to a MongoDB.</p>

<p>The following steps will try to save some data on parse server and then fetch it back. Hey ho?</p>
Expand Down Expand Up @@ -100,5 +103,6 @@
</div>
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="/public/assets/js/script.js"></script>
<input type="hidden" id="appId" value="myAppId" />
</body>
</html>

0 comments on commit 19f5ce6

Please sign in to comment.