harmony-api icon indicating copy to clipboard operation
harmony-api copied to clipboard

Cross Domain errors when using Jquery

Open teknetik opened this issue 7 years ago • 0 comments

Not su much of an issue but wanted to leave a note for the next tinkerer who might being doing something similar, not being a pro web dev I faced issues when trying to POST commands using Jquery:

no 'access-control-allow-origin' header is present on the requested resource

To avoid this I use apache to reverse proxy the API server:

<VirtualHost *:8000> ProxyPreserveHost On ProxyPass / http://192.168.1.105:8282/ Header add "Access-Control-Allow-Origin" "*" ProxyPassReverse / http://192.168.1.105:8282/ </VirtualHost>

Hope this tip might help another noob one day and issue can be closed.

teknetik avatar Aug 28 '18 09:08 teknetik