I want to create a simple web app embedded in a Confluence page that can modify page attachments. I have my code in a html macro. The devil is in the details with the API calls, so I would like something like codepen, jsbin, or jsfiddle with live-updating interactive code. I am not allowed to whitelist CORS requests from any of the services I just mentioned (or any other "external" server).
What is the best way to achieve this interactive development environment so all AJAX calls come from my internal Confluence server and avoid CORS blockage?
Hi Andrew,
Interesting question. CORS issues are browser based not server based - so it's kinda hard to work out a solution. It sounds like you want to have externally hosted code in a live editor environment - so you can edit the code and then test straight away locally.
So, you could run an outgoing proxy that takes URLs for an internal address and context path and changes it to an external path.
Otherwise, we use a browser plugin called Tampermonkey which allows for live updating of external Javascript code we host in Bitbucket. It runs locally on the browser.
I'd have to really see the configuration more and try and get my head around what's happening to understand the network topology to find a valid solution.
Can you give some more specific details or example?
Thanks,
James.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.