adelevie / parse-ruby-client

A simple Ruby client for the parse.com REST API
MIT License
415 stars 137 forks source link

"both URI are relative" when configuring after self-hosted Parse server #205

Closed hkorhola closed 8 years ago

hkorhola commented 8 years ago

I have migrated my Parse backend from Parse.com to a Heroku hosted. Now I tried to configure this Rails gem to point to my Heroku Parse backend.

I get the following error: both URI are relative:

2016-03-24T21:45:12.687459+00:00 app[web.1]: #ActionDispatch::Request:0x007fe1b904f018 2016-03-24T21:45:12.687496+00:00 app[web.1]: [DEPRECATION] init is deprecated. Please use create instead. 2016-03-24T21:45:12.697373+00:00 app[web.1]: #Userauth:0x007fe1b90bbf38 2016-03-24T21:45:12.700946+00:00 app[web.1]: 2016-03-24T21:45:12.793166+00:00 app[web.1]: propsing: both URI are relative

the configuration for gem is as instructed:


Parse.init ... quiet: false, host: ".herokuapp.com", path: "/parse")


What is the correct configuration form for host and path?

rhymes commented 8 years ago

host: ".herokuapp.com",

you need the full host: http://yourwebsite.herokuapp.com

hkorhola commented 8 years ago

Hi,

I don't think it is the problem. Because the client makes the POST request to correct "HTTPS://.herokuapp.com/1/push" address if I don't put the PATH configuration in the Gem. There the final part "/1/push" is incorrect for the self-hosted Parse server. Parse.com used it but the self-hosted has ../parse

So the first part https:://... is OK but the join function for HOST and PATH doesnt work. 25.3.2016 13.49 "rhymes" notifications@github.com kirjoitti:

host: ".herokuapp.com",

you need the full host: http://yourwebsite.herokuapp.com

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/adelevie/parse-ruby-client/issues/205#issuecomment-201247803

hkorhola commented 8 years ago

Ah, now I realize, that in my copy-paste there is characters missing. Sorry @rhymes . Configuration is like this:

    Parse.init(application_id:"jkuH8vvNl6PdYBeLoxvAYXXXX",
    api_key: "MPNe2GM23uxsgiEuuYYYY",
    quiet: false,
    host: "arcane-brook-xxxxx.herokuapp.com",
    path: "/parse")

And this gives:

both URI are relative

In source code there is the appending of "https://" for the beginning, hence it's not in host. As mentioned, it works OK without the parameter "path". I cannot join the PATH to the HOST. I tried different combinations: 1 host / and path / (slashes at the end, and in the beginning) 2 host and path / (only in path) 3 host / and path (only in host) 4 host and path (no slashes)

None works for me...

Henri

rhymes commented 8 years ago

@hkorhola as I mentioned, you have to put the entire host, with the protocol.

This works:

Parse.init(application_id:"jkuH8vvNl6PdYBeLoxvAYXXXX",
    api_key: "MPNe2GM23uxsgiEuuYYYY",
    quiet: false,
    host: "http://arcane-brook-xxxxx.herokuapp.com",
    path: "/parse")