Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 70 lines (49 sloc) 1.426 kB
d7c30d1 @tenorviol readme
authored
1 Node Parse API
2 ==============
3
7d39b8e @tenorviol defunct notice
authored
4 IMPORTANT NOTE: This api is not currently maintained.
5 If I were starting a parse project today using node.js,
6 I would probably start out with https://github.com/shiki/kaiseki
7
d7c30d1 @tenorviol readme
authored
8 install
9 -------
10
11 npm install parse-api
12
13 examples
14 --------
15
3762082 @tenorviol npm and readme stuff
authored
16 ### setup
17
d7c30d1 @tenorviol readme
authored
18 var Parse = require('parse-api').Parse;
7d39b8e @tenorviol defunct notice
authored
19
d7c30d1 @tenorviol readme
authored
20 var APP_ID = ...;
21 var MASTER_KEY = ...;
7d39b8e @tenorviol defunct notice
authored
22
d7c30d1 @tenorviol readme
authored
23 var app = new Parse(APP_ID, MASTER_KEY);
3762082 @tenorviol npm and readme stuff
authored
24
25 ### insert
26
d7c30d1 @tenorviol readme
authored
27 // add a Foo object, { foo: 'bar' }
28 app.insert('Foo', { foo: 'bar' }, function (err, response) {
29 console.log(response);
30 });
3762082 @tenorviol npm and readme stuff
authored
31
2882ad7 @sethgho Added support for uploading files.
sethgho authored
32 ### insert file
33 var fs = require('fs'),
34 fileName = 'myMedia.mp3';
35 fs.readFile(fileName, function (err, data) {
36 if (err) throw err;
37 app.insertFile(fileName, data, 'audio/mpeg', function(err, response){
38 if(err) throw err;
39 console.log('Name: ' + response.name);
40 console.log('Url: ' + response.url);
41 });
42 });
7d39b8e @tenorviol defunct notice
authored
43
2882ad7 @sethgho Added support for uploading files.
sethgho authored
44
3762082 @tenorviol npm and readme stuff
authored
45 ### find one
46
d7c30d1 @tenorviol readme
authored
47 // the Foo with id = 'someId'
48 app.find('Foo', 'someId', function (err, response) {
49 console.log(response);
50 });
3762082 @tenorviol npm and readme stuff
authored
51
52 ### find many
53
d7c30d1 @tenorviol readme
authored
54 // all Foo objects with foo = 'bar'
55 app.find('Foo', { foo: 'bar' }, function (err, response) {
56 console.log(response);
57 });
3762082 @tenorviol npm and readme stuff
authored
58
59 ### update
60
d7c30d1 @tenorviol readme
authored
61 app.update('Foo', 'someId', { foo: 'fubar' }, function (err, response) {
62 console.log(response);
63 });
3762082 @tenorviol npm and readme stuff
authored
64
65 ### delete
66
d7c30d1 @tenorviol readme
authored
67 app.delete('Foo', 'someId', function (err) {
68 // nothing to see here
69 });
Something went wrong with that request. Please try again.