OK, I figured out what I needed to do:
- Install
cors-anywherelocally and run the server - Modify the request to include the reverse proxy before the API endpoint and call the
jsonmethod in the Fetch Response object:
await (fetch("http://localhost:8080/mycommunity.com/g.json", {
headers: {
"Api-Username": Secret("DISCOURSE_USERNAME"),
"Api-Key": Secret("DISCOURSE_KEY")
},
})).json()