← Back to team overview

dhis2-devs team mailing list archive

Re: Accessing DHIS2 instance from an external app

 

On Wed, Feb 28, 2018 at 11:00 AM, Petar Jovanovic <petar@xxxxxxxxxxxx> wrote:
> Hello,
>
> We have a DHIS2 instance running on the server. We are testing another
> (external) javascript app and its access to this DHIS2 instance.
>
> When executing it locally on our PC we are getting an HTTP 0 error saying
> that a cross-domain resource was requested but no CORS headers in the
> response.
>
> We've checked the DHIS2 setting for the CORS whitelist
> (https://docs.dhis2.org/2.28/en/user/html/system_access_settings.html), but
> it is not clear what URL we should put if this external app is executing
> locally on our PC? Is there any workaround for this or we have to execute
> the app on the public URL that should be placed in the whitelist?

Hi Petar,

what do you exactly mean with "executing it locally on our PC"?
I assume the app is running in the browser and the URL resembles
something like http://localhost:3000.
If that's the case, that is the address you need to add in the CORS
whitelist, it must include the port if any is used.

Hope this helps,
-- 
Edoardo Sabadelli
DHIS 2
University of Oslo
edoardo@xxxxxxxxx
http://www.dhis2.org


Follow ups

References