Skip to content

Failed to run signUp function in cloud code #732

Closed

Description

@zhouhao27

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.

Activity

  1. zhouhao27 commented on Mar 1, 2016

    @zhouhao27
    Author

    Maybe I should use RestAPI instead of JavaScript SDK?

  2. zhouhao27 commented on Mar 1, 2016

    @zhouhao27
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions