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

Notice things break when I change origin line #52

Open
silasb opened this issue Feb 16, 2022 · 1 comment
Open

Notice things break when I change origin line #52

silasb opened this issue Feb 16, 2022 · 1 comment

Comments

@silasb
Copy link

silasb commented Feb 16, 2022

I'm evaluating different zero-js blog solutions and Elderjs came with some high regards. After experimenting with it I noticed that whenever I'd change my origin line in the config file Elderjs would start to act funny:

  • Websocket connections would try connecting a different hostname/port
  • File changes wouldn't propagate (likely due to above)

I looked through the code and it seems like this http://example.com is hardcoded, but I couldn't pinpoint where the issue was.

I'm creating this issue to understand what the setting should be? Should there be better documentation around this?

@TotalLag
Copy link

Where are you previewing it? It will act funny locally so you'll need to refer to your local address. I changed the line to something like this:

origin: process.env.NODE_ENV === 'production' ? 'https://example.com' : 'http://localhost:3000'

That way when you're developing locally, it will hit the correct host (localhost) until you publish.

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