Using medplum's FHIR Library (fhirtypes) and orig...
# support
c
Hello, I'm new here and learning about programming and FHIR Library (of Javascript, typescript). I'm trying to use your services in Svelte project and to connect with one company's FHIR server which I'm a member of a company. However, the display shows the CORS error. Does anyone know how to cope with it? I wrote like this (also, already installed @medplum/fhirtypes, @medplum/core). I changed the detailed baseUrl in case of security issue.
Copy code
svelte
<script lang="ts">
 import { MedplumClient } from '@medplum/core';

 const client = new MedplumClient({
  baseUrl: 'http://fhirserverBaserURL',
  fhirUrlPath: ''
 });

 const result = client
  .createResource({
   resourceType: 'Patient',
   name: [
    {
     given: ['George'],
     family: 'Washington'
    }
   ]
  })
  .then((response) => console.log(response));

 // const readPatient = client.readResource('Patient', '6').then((response) => console.log(response));
</script>
r
HI @capybara_29309 - we don't officially support svelte
That being said, your CORs issue is probaly independent of that
Is your app being deployed on the same domain as
fhirserverBaserURL
? If not, you will need the configure the FHIR server to allow requests from your App's domain
181 Views