shiki / kaiseki

A Parse.com REST API Client for Node.js
MIT License
223 stars 43 forks source link

object created = { error: 'unauthorized' } parse server and a mongodb instance on a local device and using port forwarding #37

Open alexrmacleod opened 8 years ago

alexrmacleod commented 8 years ago

Does this work with parse-server?

I am running parse server and a mongodb instance on a local device and using port forwarding. Will kaiseki work with this setup?

I try to save an object like so but I get back:

Code that can't seem to save an object

`

// instantiate kaiseki var config = { serverUrl: 'http://42.3.160.96:1337/parse', applicationId: 'x', // restAPIKey: 'x' // masterKey: 'x' // optional // mountPath: '/parse' // optional ("/parse" by default) };

// var kaiseki = new Kaiseki(config);

var APP_ID = 'x'; var REST_API_KEY = 'x'; var kaiseki = new Kaiseki(config, REST_API_KEY);

//new tumblr to query var blog = new tumblr.Blog('the-streetstyle.tumblr.com', oauth);

var tumblrAccount = {};

//username - profile picture - website for parse blog.info(function (error, response) { if (error) { throw new Error(error); } console.log('blog.INFO.RES ------------'); console.log('blog.title ------------'); console.log(response.blog.title); tumblrAccount.title = response.blog.title;

console.log('blog.user_name ------------');
console.log(response.blog.name);
tumblrAccount.user_name = response.blog.name;

console.log('blog.url ------------');
console.log(response.blog.url);
tumblrAccount.url = response.blog.url;

console.log('tumblrAccount ------------');
console.log(tumblrAccount);
// use kaiseki
var className = 'Tumblr';

kaiseki.createObject(className, tumblrAccount, function (err, res, body, success) {
    console.log('object created = ', body);
    console.log('object id = ', body.objectId);
});

});

blog.avatar(512, function (error, response) { if (error) { throw new Error(error); } console.log('blog.AVATAR.RES ------------'); console.log(response.avatar_url); tumblrAccount.avatar_url = response.avatar_url; });

` CLI response below:

`

object created = { error: 'unauthorized' } object id = undefined

`

alexrmacleod commented 8 years ago

got it working by setting the mountPath: ''

shiki commented 8 years ago

Are you still having problems?