I figured out the solution. Simply, I didn’t need the proxy at all and instead just needed to use node_helper.js to make the API call for me. Made sense once I thought of it. I THINK my module is now working fully as expected, but I’ll monitor it over the next week or so to make sure.
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
P
Offline
Latest posts made by pclark2
-
RE: Trouble using CORS proxy
-
Trouble using CORS proxy
I am trying to use the built in CORS proxy to call the Jira API. I’ve successfully done this before using CORS Anywhere, but would prefer to use the built in proxy. It seems to be returning an empty result of {}, even though it should return more even if you aren’t authenticated. I’m assuming I am just using the proxy function incorrectly. Below is my code:
const headers = `Authorization:${"Basic " + btoa(this.config.username + ":" + this.config.apiKey)}`; const url = "/cors?sendheaders=" + encodeURIComponent(headers) + "&url=" + encodeURIComponent(`${this.config.jiraInstance}/rest/api/latest/search?jql=${this.config.jiraFilter}&maxResults=${this.config.maxResults}`);
I should note that my coding knowledge is extremely limited, so I am really going beyond my abilities here. Anything here jump out to anyone?