-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Web Plugin Access-Control-Allow-Origin header not present #1236
Comments
Just tested the snippet I refer to above and it works. I placed the whole snippet into a new file called crossdomain.py inside the beetsplug/web directory and then edited beetsplug/web/init.py as such: Near the top: Below each route or pair of routes, added: For example:
|
Hi! Awesome; I'm glad you're interested in working on this. I'm not sure if it's clear from the paper-trail of recent issues, but there is a new effort to start from scratch with the web API. See #738, #718, #1002, and AURA. The AURA reference server has CORS enabled. So we can add a cross-domain header to the current plugin in the short term (care to open a PR?), but soon we will be throwing this one away and adding a new backend. So if you're building a new frontend, let's stay in touch—it would be great to get compatible with the new backed as quickly as possible. |
Thanks sampsyo. I'll go check out AURA, I didn't know it existed! I discovered beets about two days ago after getting frustrated with online streaming services and decided to turn my own music collection into something I can stream. It looked perfect but I wanted a better web player, so of course I jumped in and started hacking without looking at all the documentation and current development :). |
Awesome; I think we have exactly the same goal:
😃 My ultimate dream with AURA is indeed to have a good, interoperable alternative to streaming services. |
In the meantime I created a pull request. My first one, so I am not sure I did it 100% correct. |
@sampsyo I hacked together a quick example here: https://github.com/andremiller/beets-player-samples/tree/master/w2ui This still uses the beetsweb plugin and it's quite ugly, more of a proof of concept. |
Very cool! This looks useful already. I'll totally give it a try. |
I'm putting together a client-side HTML5/Javascript player that uses the Web plugin's REST/JSON API.
Because the source files for the client is not hosted by the flask web server, I'm getting the following error in the browser when I try to make API calls using XMLHttpRequest in Javascript:
Is there a way the beets web server can be configured to provide this header so remote browsers can access the API?
PS: I found this link which has an example of how to implement it in Flask: http://flask.pocoo.org/snippets/56/
The text was updated successfully, but these errors were encountered: