This mediator is intended for retrieving submission data from ODK Central and storing the data into the MySQL Repository.
The private-config.json
is used to store all the credentials and connection URLs of the mediator. The credentials are currently left out, so the file needs to be renamed with all the required credentials and URLs before installation for the mediator to work.
To run the mediator without connecting it to the OpenHIM server, you can use the following commands if you have Node.js
installed:
-
cd ptracker-odk-central-mediator
-
npm install
-
Create a database called
mysqlrepo
-
npm start
The mediator can be built and run using the docker-compose.yml
file configurations.
-
Navigate to
odk-central-mediator
folder where thedocker-compose.yml
is. -
docker-compose build
-
docker-compose up -d
-
docker network create openHIM
-
docker exec -it <container id> sh
-
mysql -u root -h<mysql image name> -P<mysql port> -p
-
CREATE DATABASE IF NOT EXISTS
mysqlrepo
;
You can run the Unit tests using the following command:
-
cd ptracker-odk-central-mediator
-
npm run test