Skip to content

Commit

Permalink
example of how to update config
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaban committed Jul 15, 2021
1 parent ee3b3a5 commit ef90a5a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/updateConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const fs = require('fs');
const async = require('async');
const path = require('path');
const request = require('request');
const uploadResults = require('./uploadResults');
const logger = require('../server/lib/winston');



const agentOptions = {
cert: fs.readFileSync(
'../server/clientCertificates/openmrs_cert.pem'
),
key: fs.readFileSync(
'../server/clientCertificates/openmrs_key.pem'
),
ca: fs.readFileSync('../server/serverCertificates/server_cert.pem'),
securityOptions: 'SSL_OP_NO_SSLv3',
};
const auth = {
username: 'openmrs',
password: 'openmrs'
};
const options = {
url: 'https://localhost:3000/updateConfig/',
agentOptions,
// auth,
json: [
{ "systems:internalid:uri": ["http://openmrs.org/openmrs2", "http://dhis2.org/internalid"] }
],
};
request.post(options, (err, res, body) => {
if(err) {
logger.error(err);
}
logger.info(body)
});

0 comments on commit ef90a5a

Please sign in to comment.