i'm trying to write some frontend code using maker API and when I do a get or a post, i get a CORS error. code is running on localhost . i tried hitting against my local and against the cloud api - same result.
what's the recommended way to access the api from a JavaScript app?
Maker API CORS error?
Certainly not the only one. This thread has had a little discussion Cross origin.
Would help to have more info on what you are trying to do. I've managed to work this using a node package
http-cors-proxy - npm that creates a proxy address and works for my experiments.
There is also a chrome extension that helps with issues if you are working direct from the browser. Allow CORS: Access-Control-Allow-Origin - Chrome Web Store
Hope these help - others much more knowledgable can comment and there's a lot of advice to be found out there - Google is a friend.
well, the issue for me is i'm trying to do this server-less... at least for now. just static files are sufficient to do what I need, so as such, i can't do a proxy or the like. wish i could configure maker api to add domains or ignore cross-origin
A fix has been submitted for Maker API to allow local access to the endpoints with a configurable list of hosts to allow.
We don't give ETAs on software releases. Not sure if it will make it in the next version or not. When I know, I will update.
Great news ( Thank you Hubitat !) Today's release.
- Maker API added optional CORS support by host name for LAN connections only.
Any pointers as to how we implement this? Thanks for incorporating - will save some of the hoops I've been jumping through when I play with this...
Is there a proper way to update the maker app short of removing/reinstalling and then reenabling devices?
Do I really need to list the many devices in my house (AKA, repurposed smartphones) that need access?
I'm running my own shim (proxy) but it would be nice to go direct.
does it support wild cards? I am running off a local unhosted static file (just opening an html file from a browser). So in this case, i'd like to just add * or something of the sort.. or 192.168.. ?