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

restivus breaks iron:router on deployed apps #3

Closed
hujhax opened this issue Feb 2, 2015 · 7 comments
Closed

restivus breaks iron:router on deployed apps #3

hujhax opened this issue Feb 2, 2015 · 7 comments

Comments

@hujhax
Copy link

hujhax commented Feb 2, 2015

Check out the following two deployed apps:
functional site
busted site

They are both supposed to show a homepage, but the second one shows the iron:router splash page. The only difference between them is that I initialized a RESTivus endpoint in the latter one.

The busted site still works fine on my local server -- it only gets confused and splash-screen-y when I deploy it. I've tried deploying to meteor and to heroku -- both produce the same result.

@kahmali
Copy link
Owner

kahmali commented Feb 2, 2015

Alright, let me look into this. I have the latest version of Restivus in an app that uses Iron Router fairly extensively, and it's deployed on both meteor and digital ocean and both are working fine. There must be something else to the error besides simply having Restivus in the deployed app. I absolutely hate those Iron Router errors. I get them all the time and the strangest things seem to cause them. So frustrating! I'll check out your repro apps and keep you posted. Thanks for reporting the issue.

@hujhax
Copy link
Author

hujhax commented Feb 2, 2015

Thanks! And let me know if there's anything I can do to help.

@kahmali
Copy link
Owner

kahmali commented Feb 2, 2015

I think you made your test repo private. Could you please add me as a collaborator or make it public so I can check it out?

@hujhax
Copy link
Author

hujhax commented Feb 2, 2015

Derp! I am not smarting well today. It's public now.

@kahmali
Copy link
Owner

kahmali commented Feb 2, 2015

I was able to get it to run when deployed on meteor by making the call to Restivus.add() from within Meteor.startup(). So in lib/restivus.js:
Change:

Restivus.add('test', {
    get: {
        action: function() {
            return "Hello World!";
        }
    }
});

to this:

Meteor.startup(function () {
    Restivus.add('test', {
        get: {
            action: function() {
                return "Hello World!";
            }
        }
    });
});

Would you be able to test that on Heroku when you have a chance and let me know if it works? I will make sure I add that to the docs. I've always done it that way, but I need to say it explicitly in the docs. Sorry about that!

@hujhax
Copy link
Author

hujhax commented Feb 2, 2015

We're good on heroku! Thanks so much!

kahmali added a commit that referenced this issue Feb 2, 2015
- Update README
  - Update Quick Start examples so Restivus is configured and built from
    within the Meteor.startup() callback
  - Add "Important!" note in the Configuration and Defining Routes
    sections that these must be done from within the Meteor.startup()
    callback
kahmali added a commit that referenced this issue Feb 2, 2015
- Update README
  - Update Quick Start examples so Restivus is configured and built from
    within the Meteor.startup() callback
  - Add "Important!" note in the Configuration and Defining Routes
    sections that these must be done from within the Meteor.startup()
    callback
kahmali added a commit that referenced this issue Feb 2, 2015
- Update README
  - Update Quick Start examples so Restivus is configured and built from
    within the Meteor.startup() callback
  - Add "Important!" note in the Configuration and Defining Routes
    sections that these must be done from within the Meteor.startup()
    callback
kahmali added a commit that referenced this issue Feb 2, 2015
- Update README
  - Update Quick Start examples so Restivus is configured and built from
    within the Meteor.startup() callback
  - Add "Important!" note in the Configuration and Defining Routes
    sections that these must be done from within the Meteor.startup()
    callback
@kahmali
Copy link
Owner

kahmali commented Feb 2, 2015

Alright, I updated the docs with that information. Sorry if you were alerted each time I rebased that commit. I have to push to test the GitHub markdown, and I was just making some minor cosmetic updates so I had to squash the commits.

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

2 participants