PrimeSmart / OmniHub

Your knowledge hub.
0 stars 0 forks source link

Can't find where to set CORS #4

Open zacharybuck opened 8 years ago

zacharybuck commented 8 years ago

Always get CORS error (Reason: CORS header 'Access-Control-Allow-Origin' missing)) when trying to get result from template engine http://localhost:8000/queries.json on client side Where I can set it? Can't find anything in docs. Thanks!

kevcarr commented 8 years ago

I think, at present there is no way to set some configuration parameter to make CORS work with OmniHub. Underneath, it uses Spray HTTP, which can only support CORS if the header is added on every Response. This at the moment is not configurable.

However, you may try using a reverse proxy like Nginx ( enabled with CORS ), to make it work. Essentially, put a man in the middle that allows CORS.

http://www.html5rocks.com/en/tutorials/cors/ http://enable-cors.org/server_nginx.html If you are feeling adventurous, you can look at the following code, and see if you can fix this:

https://github.com/primesmart/omnihub/blob/v0.9.4/core/src/main/scala/io/prediction/workflow/CreateServer.scala#L490

zacharybuck commented 8 years ago

Thanks for the response! I'll use nginx proxy on production. But for those who are on development I would suggest to run chrome browser like this: google-chrome --disable-web-security (ubuntu 14)

PrimeSmart commented 8 years ago

Zachary Buck on Salesforce commented: This is a test. Test test test,

PrimeSmart commented 8 years ago

hahaha that's your problem, not mine.

PrimeSmart commented 8 years ago

Boop!

PrimeSmart commented 8 years ago

Zachary Buck on Salesforce commented: boop

PrimeSmart commented 8 years ago

beep

PrimeSmart commented 8 years ago

Zachary Buck on Salesforce commented: beep boop

PrimeSmart commented 8 years ago

Zachary Buck (@zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented: boop beep boop

PrimeSmart commented 8 years ago

zacharybuck-cgtest1@marblemethodsoftware.com(Zachary Buck) on Salesforce commented: @kevinleecarr testing references

PrimeSmart commented 8 years ago

Zachary Buck (zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented: This should be formatted better.

PrimeSmart commented 8 years ago

Zachary Buck (zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented:

boop? Beep!

PrimeSmart commented 8 years ago

beep? boop!

PrimeSmart commented 8 years ago

Zachary Buck (zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented:

Much comment. (logs on!)

PrimeSmart commented 8 years ago

COMMENT

PrimeSmart commented 8 years ago

blarp

PrimeSmart commented 8 years ago

boooooooop?

PrimeSmart commented 8 years ago

I'd like to see this as a comment

PrimeSmart commented 8 years ago

Zachary Buck (zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented:

Yes, I expect you would.

PrimeSmart commented 8 years ago

Zachary Buck (zacharybuck-cgtest1@marblemethodsoftware.com) on Salesforce commented:

this is to test if comments are updated