Meteor-Community-Packages / react-router-ssr

Simple isomorphic React SSR for Meteor with subscribed data re-hydration
MIT License
24 stars 4 forks source link

How to access the host uri? #39

Open eminx opened 3 weeks ago

eminx commented 3 weeks ago

My application is designed and works in a way that I host many different websites in one server and db. Every each content that is generated by users in each website is saved with its host uri - that is the website address.

I can retrieve the connected client host uri in each method call in Meteor, like this:

Meteor.methods({
  getData() {
    const host = this.connection.httpHeaders.host;
    return Collection.find({host: host}).fetch();
  }
});

My problem is in the React component rendered in the server, I cannot access the host uri with this above function or similar! Any ideas?

Thanks!

github-actions[bot] commented 3 weeks ago

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee you issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know