Skip to content

Commit

Permalink
Merge pull request #23 from mojaloop/bugfix/reports
Browse files Browse the repository at this point in the history
Bugfix/reports
  • Loading branch information
partiallyordered authored Jan 30, 2020
2 parents 5c5c65e + 8d33a5c commit 5a7c9e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const config = {
reflectOrigin: process.env.CORS_ACCESS_CONTROL_REFLECT_ORIGIN === 'true',
},
reportUrls: {
312: process.env.HUB_REPORT_URL_312,
644: process.env.HUB_REPORT_URL_644,
},
};

Expand Down
2 changes: 2 additions & 0 deletions src/handlers/report.js.sample → src/handlers/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const handler = (router, routesContext) => {
};

const reportUrl = new URL(routesContext.config.reportUrls[reportId]);
routesContext.log(`Found report URL: ${reportUrl}`);
const completeUrl = await generateReportUrl(ctx.request, reportUrl, reportId);
routesContext.log(`Generated report request: ${completeUrl}`);

try {
const response = await fetch(completeUrl, opts);
Expand Down

0 comments on commit 5a7c9e2

Please sign in to comment.