The middleware API service component for the Get a COVID-19 test result service. This API is consumed by the Drupal 8 webforms site and also the SMS Notification scheduler component.
The component exposes the API endpoints documented in Swagger.
The component is intended to run from within a Docker container.
- Pull the code from the Git repository.
- Create the environment file from the template:
cp .env.base .env - Populate the
.envenvironment file with the Meditech test result database credentials. - Copy
database.db.basetodatabase.dbwhich will be the running SQLite database file. The database is initially empty. - Create
docker-compose.override.ymlfrom the instructions indocker-compose.ymland set the external port number. - Launch the container:
sudo docker-compose up --build -d - Attach to a shell in the container image:
sudo docker exec -it <name> bash - Install the NPM requirements:
npm install - Exit the container and verify from a remote server that the component is responding
and able to connect to the database:
curl -v http://<docker-server>:<external-port>/. Expect an HTTP 200 response with the message "Successful Connection".
Run the test-uat script against the component configured to read from the sample
database:
./test-uat http://<docker-server>:<external-port>
If no output is shown, the tests were successful.
The test script will cause records to be written to the SQLite to_notify and
viewed_result tables.