lidaof / eg-react

WashU Epigenome Browser
https://epigenomegateway.wustl.edu
Other
66 stars 29 forks source link

Other solutions to CORS? #294

Closed yoyoong closed 1 year ago

yoyoong commented 1 year ago

I get the track data from data server and failed: 1669701956668

And I know the problem but I cannot to configure the server to support CORS because of the security policy. So I want to ask whether other solutions to this problem? I have tried to use the proxy but it didn't work, and following is an example. I don't know what's the problem. Thanks for you reply. proxySetup.js: 1669701916900 usage: 1669701933488 the proxy didn't work(/api did not replace to target url in setupProxy): 1669701901685

lidaof commented 1 year ago

Hi @yoyoong you should use another software like Apache for setting up the web server for hosting bigwig files, or an easier solution is to use http-server JS package. so here is what you can do, install the http-server package, go to the folder where bigwig files located, run http-server ./ --cors, then use the URL for submitting as a remote track. let me know if things don't work.

yoyoong commented 1 year ago

Thank you very much! The http-server works to get data by url.But I curious if there is a safety problem to use http-server. And the differents of use http-server and enable CORS on apache. Thanks for you reply.

lidaof commented 1 year ago

hello, I don't think there is any safety issue you need to worry about, it's a very popular web server software by JavaScript. Apache is better with the performance I think. They are functioning for the same purpose with CORS enabled to host track files.

yoyoong commented 1 year ago

OK, Thank you very much!

lidaof commented 1 year ago

you are welcome! closing this one, feel free to open new issues.