parse-server-example icon indicating copy to clipboard operation
parse-server-example copied to clipboard

Unable to connect to Parse API

Open david-koch-pro opened this issue 10 years ago • 12 comments

Here is my server configuration. (index.js) screen-shot-2016-05-24-at-10 54 37

And here is my cloud code. (/cloud/main.js) screen-shot-2016-05-24-at-11 01 44

For testing, I run this command.

screen-shot-2016-05-24-at-11 05 31

Then I got this message. {"code":141,"error":"XMLHttpRequest failed: "Unable to connect to the Parse API""}

I tried all reference of Git about this problem but couldn't fix this problem. Please help me.......

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

Have you configured your process.env.SERVER_URL variable?

KasparasMasiukas avatar May 24 '16 09:05 KasparasMasiukas

I don't know how to set process.env.SERVER_URL. I thought it would be set automatically.

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

And I could get server log and it was running well.

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

Have you looked at .ebextensions/app.config file? Myself I run parse-server on Heroku, I set my environmental variables by using external module - https://www.npmjs.com/package/dotenv

KasparasMasiukas avatar May 24 '16 09:05 KasparasMasiukas

.ebextensions/app.config screen-shot-2016-05-24-at-11 24 35

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

I already set environmental variables. Can you show me how to use external module?

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

If it still doesn't work, I don't know how to help. Perhaps somebody with Elastic Beanstalk expertise will.

KasparasMasiukas avatar May 24 '16 09:05 KasparasMasiukas

Please teach me how to use "dotenv". It might be able to help me.

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

Please read the instructions on the page I've sent you. I cannot explain any better than that.

KasparasMasiukas avatar May 24 '16 09:05 KasparasMasiukas

Thank you Kasparas42180 Anybody else? Please help me

david-koch-pro avatar May 24 '16 09:05 david-koch-pro

I have same problem. I use amazon EB as hosting. To fix problem i restart application, but problem again repeated.

Logs: ParseError { code: 100, message: 'XMLHttpRequest failed: "Unable to connect to the Parse API"' }

stalehard avatar May 26 '16 13:05 stalehard

You may check the document here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions-optionsettings.html

Example .ebextensions/options.config option_settings:

  • option_name: SERVER_URL value: 'YOUR_SERVER_URL'

jeffhuangtw avatar Jul 28 '16 04:07 jeffhuangtw