MccCareplan / patientsmartapp

Patient facing mobile smart on fhir Web app for multiple chronic condition care plans
Apache License 2.0
2 stars 2 forks source link

Configure Code Default Servers #9

Open ferret1964 opened 3 years ago

ferret1964 commented 3 years ago

Setup the project with default configuration for development and production: This should support an override at run time when running in a node container.

Endpoints that Require configuration and defaults

                          Development.                                                                               Production

API Server. Localhost https://mcc-niddk-backend.wl.r.appspot.com' Launch Server. https://launch.smarthealthit.org/v/r4/sim/eyJrIjoiMSJ9/fhir
clientId testId client_secert. test

Note: The URL for launch testing is at https://launch.smarthealthit.org/?auth_error=&fhir_version_1=r4&fhir_version_2=r4&iss=&launch_pt=1&launch_url=&patient=&prov_skip_auth=1&provider=&pt_skip_auth=0&public_key=&sb=&sde=&token_lifetime=15&user_pt=

ferret1964 commented 3 years ago

The environment.ts and environment.prod.ts should able to be upgrade to include similar to:

mccapiUrl: process.env.API_SERVER || 'https://mcc-niddk-backend.wl.r.appspot.com', clientId: process.env.CLIENTID || '0950cf46-841c-466f-8bfb-19aa7d351b77'

This assumes that Node and & Express are already part of the project. However in trying this approach I cam currently getting errors. Finding a bit of conflicting information on how to do this at run time.

Possible clues might be found here: https://pumpingco.de/blog/environment-variables-angular-docker/ or https://stackoverflow.com/questions/56682945/pass-environment-variables-to-angular-container-docker-post-build