Backend endpoints for the urgent care application.
Before you can run locally or deploy, you must copy in the env files from the ottehr-secrets repository. These should be copied into .env/
(e.g. dev: .env/dev.json
).
The backend is run locally using the Serverless Framework with the Serverless Offline plugin.
Start up the local API Gateway + Zambda emulator with:
npm run start:local
Currently available scripts:
TODO describe function
npm run create-subscription:dev
Set secrets for each environment.
npm run setup-zapehr-secrets
Deploy zambdas for each environment. Calls npm run package
.
npm run deploy-zambdas
These steps are kept here in case you need to deploy an individual zambda manually.
- Run
npm run package
. This will put deployment zips ready to be uploaded to the zapEHR platform into the.dist/
folder. - Go to the console you want to deploy to (e.g. testing).
- Log in with the appropriate account previously used for 'One Time Setup'.
- Navigate to /zambdas on the console (e.g. testing).
- Click on the zambda you are trying to update
- Click the button "Upload zambda.zip"
- Select the appropriate zip from the
.dist/
directory. - Click "Deploy using {zambda-name}.zip"
- Click the refresh icon and make sure the status is "Active"