Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.

Cross-origin errors #3

Closed
kfrederix opened this issue Sep 3, 2014 · 2 comments
Closed

Cross-origin errors #3

kfrederix opened this issue Sep 3, 2014 · 2 comments

Comments

@kfrederix
Copy link

When following the install instructions on latest version, I ended up with cross-origin errors:
"XMLHttpRequest cannot load https://0.0.0.0:3000/api/settings. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost:9000' is therefore not allowed access."

I think loopback 2.0 should have CORS enabled by default, so any ideas what might be the problem here?

@kfrederix
Copy link
Author

For anyone who might be interested: the cross-origin errors were resolved for me by changing the loopback_angular apiUrl from "https://0.0.0.0:3000/api/" to "https://127.0.0.1:3000/api" in Gruntfile.js.

@beeman
Copy link
Member

beeman commented Oct 18, 2014

Hi @kfrederix! Thanks for your comments.

In one of the recent commits I fixed this issue by making the API url relative in the default builds. If you want to get it working with a different URL (for livereload for instance) you can use the API_URL environment variable.

I hope this works for your use case. If not, please let me know!

@beeman beeman closed this as completed Oct 22, 2014
beeman pushed a commit that referenced this issue Jan 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants