Backbone plugin for using parse.com
This plugin use parse Rest API (Not use javascript API).
Use for personal application or mock creation or hackason event.
- you must regist parse.com
- you must create project
- check your ApplicationId and RestAPIKey in your settings(url may be
https://parse.com/apps/your-project/edit#app_keys
)
All steps are very easy! Please check parse.com
Download the production version or the development version.
First, you must configure applicationId and RestAPIKey(not js api).
So, you can use Parse when write useParse:true
in model or collection.
This is example code.
<script src="dist/backbone-parse-sync.min.js"></script>
<script>
// settings
window.parseHeaders = {
ApplicationId: "*****************************",
RESTAPIKey: "*****************************"
};
// Model
TestModel = Backbone.Model.extend({
useParse: true,
urlRoot: "/blogs" // this means using parse 'blogs' object
});
testObject = new TestModel();
testObject.set({'name': 'test'});
testObject.save();
// Collection
TestCollection = Backbone.Collection.extend({
useParse: true,
url: "/blogs",
model: TestModel
});
new TestCollection().fetch();
</script>
If you'd like to use parse query, you can add save options.
This plugin does not provide such function. :-)
Copyright (c) 2013 ryuma.tsukano
Licensed under the MIT license.