Skip to content

GopherJS Playground: Snippets are failing to load/save due to host name change. #20

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

Closed
dmitshur opened this issue Jan 16, 2015 · 9 comments

Comments

@dmitshur
Copy link
Member

Snippets are currently not working. It seems that the hostname was previously http://gopherjs.org, but now it redirects to http://www.gopherjs.org (/cc @neelance, @ajhager), which results in the XHR failing:

XMLHttpRequest cannot load http://snippets.gotools.org/p/D9L6MbPfE4. The 'Access-Control-Allow-Origin' header has a value 'http://gopherjs.org' that is not equal to the supplied origin. Origin 'http://www.gopherjs.org' is therefore not allowed access.

dmitshur added a commit to gopherjs/snippet-store that referenced this issue Jan 16, 2015
@dmitshur
Copy link
Member Author

Fixed with gopherjs/snippet-store@06a3903 and deploying the new version of snippet-store that uses the new http://www.gopherjs.org value for Access-Control-Allow-Origin header.

@neelance
Copy link
Member

Thx for the fix. What about putting the snippet store to a proper subdomain?

@dmitshur
Copy link
Member Author

What about putting the snippet store to a proper subdomain?

What do you have in mind?

@neelance
Copy link
Member

Just snippets.gopherjs.org instead of snippets.gotools.org.

@dmitshur
Copy link
Member Author

That is completely okay with me. It requires 3 steps:

  • you map that subdomain to the same IP as the current one,
  • I'll add a port 80 redirect for that subdomain host to snippet-server.
  • change playground source to use new name and redeploy.

@neelance
Copy link
Member

DNS record created.

@dmitshur
Copy link
Member Author

Port 80 redirect rule added, http://snippets.gopherjs.org/p/D9L6MbPfE4 now works.

The last remaining step is to change playground.go source to use the new host, rebuild it, and deploy (by merging the PR).

@dmitshur
Copy link
Member Author

Okay, I've started the last step in PR #21, but neelance/go-angularjs#7 needs to be merged first and then the playground needs to be rebuilt (run update.sh) before that PR can be merged.

@dmitshur
Copy link
Member Author

Last step done in #21, and with that the transition to snippets.gopherjs.org instead of snippets.gotools.org is complete.

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