Skip to content

Don't use https://api.parse.com/1 as default serverURL #464

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

Merged
merged 1 commit into from
Feb 19, 2016
Merged

Don't use https://api.parse.com/1 as default serverURL #464

merged 1 commit into from
Feb 19, 2016

Conversation

simonbengtsson
Copy link
Contributor

The parse js sdk uses https://api.parse.com/1 as default serverURL for obvious reasons. However I can't think of a common use case for it in Parse Server and it might be confusing #356 #407 #477. This pull request simply overwrites the default url with en empty string if the user does not specify it.

When using queries in cloud code and forgetting to change the serverURL you currently get a ParseError { code: undefined, message: 'unauthorized' }. With this change you instead get a ParseError {code: 100, message: 'XMLHttpRequest failed: "Unable to connect to the Parse API"' }. This might only be a slight improvement, but it makes it possible to add a custom error message in the parse js sdk when no serverURL is found.

It might also be desirable to make serverURL a required property or adding a warning when it is not set?

@drew-gross
Copy link
Contributor

Awesome, I think this will improve the usability of Parse Server quite a bit. I like your idea of making it required, though, I think that would be an even better experience. @gfosco is there any situation where you wouldn't care if serverURL isn't set? Maybe if you don't have cloud code? If thats the case we could require a serverURL only if any Cloud Code is also provided.

@flovilmart
Copy link
Contributor

the Parse SDK need the serverURL, for any code running on the server whether it's Cloud Code or not.

@facebook-github-bot
Copy link

@simonbengtsson updated the pull request.

@gfosco
Copy link
Contributor

gfosco commented Feb 19, 2016

I like this because at least it will fail, rather than incorrectly calling Parse. If users run in to problems here, we'll have to readdress how we enforce it.

gfosco added a commit that referenced this pull request Feb 19, 2016
@gfosco gfosco merged commit 3087b21 into parse-community:master Feb 19, 2016
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

Successfully merging this pull request may close these issues.

5 participants