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

Failed to run signUp function in cloud code #732

Closed
zhouhao27 opened this issue Mar 1, 2016 · 2 comments
Closed

Failed to run signUp function in cloud code #732

zhouhao27 opened this issue Mar 1, 2016 · 2 comments

Comments

@zhouhao27
Copy link

Here is my code:

Parse.Cloud.define('register',(req,res) => {
  var email     = req.params.email
  var password  = req.params.password
  var name      = req.params.name

  var user = new Parse.User()
  user.set('email',email)
  user.set('password',password)
  user.set('username',name)

  user.signUp(null, {
    success: (user) => {
      res.success('success')
    },
    error: (user,error) => {
      res.error(error)
    }
  })      

Got the following error message:

{
"code": 141,
"error": {
"code": 100,
"message": "XMLHttpRequest failed: "Unable to connect to the Parse API""
}
}

Why is that? I've set X-Parse-Application-Id in my header already.

@zhouhao27
Copy link
Author

Maybe I should use RestAPI instead of JavaScript SDK?

@zhouhao27
Copy link
Author

Found the issue. The serverUrl I used in parse-example is incorrect. After I changed to correct wrong, everything is fine.

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

1 participant