This mediator is intended for sending request to sante mpi server
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.
-
Node.js 12 or later
-
npm (version 6 or higher)
-
MongoDB
-
Docker
-
OpenHIM
-
Postgress
To run the mediator without connecting it to the OpenHIM server, you can use the following commands if you have Node.js
installed:
-
Clone or download the repository.
git clone https://github.com/UCSF-GP-Namibia/sante-mpi-openhim-mediator.git
-
cd sante-mpi-mediator
-
Run
npm install
to install the dependencies -
Start the development server with
npm start
The mediator can be built and run using the docker-compose.yml
file configurations.
-
Clone or download the repository.
git clone https://github.com/UCSF-GP-Namibia/sante-mpi-openhim-mediator.git
-
Navigate to
odk-central-mediator
folder where thedocker-compose.yml
is. -
docker-compose build
-
docker-compose up -d
-
docker network create openHIM
You can run the Unit tests using the following command:
-
cd sante-mpi-mediator
-
npm run test
-
Make a
GET
request to/localhost:8080/getResource?:url
to retrieve Sante MPI Resources -
Make a
POST
request to/localhost:8080/postResource
to create Sante MPI Resources. -
Make a
PUT
request to/localhost:8080/updateResource/:id
to update Sante MPI Resources.
The API uses a Beaer Token
for authentication. To access the endpoints, you will need to pass a valid token in the Authorization header of your requests.
-
Make a
POST
request to/localhost:8080/userAuth
endpoint which Receives token from SanteMPI upon accepted user credentials -
Make a
GET
request to/localhost:8080/getResource?:url
to Validate user token with SanteMPI.
The API uses the following error codes:
-
401
Unauthorized: The request could not be authenticated. -
404
Not Found: The requested resource could not be found. -
500
Internal Server Error: An error occurred on the server.
For more information on the API, please contact the developer.