Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexrmacleod opened this issue Jul 9, 2016 · 2 comments

Comments

@alexrmacleod
Copy link

alexrmacleod commented Jul 9, 2016

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
Copy link
Author

got it working by setting the mountPath: ''

@alexrmacleod alexrmacleod changed the title Parse-server support? object created = { error: 'unauthorized' } parse server and a mongodb instance on a local device and using port forwarding Jul 9, 2016
@shiki
Copy link
Owner

shiki commented Jul 29, 2016

Are you still having problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants