From 75ca74817bcbbcb7c37b4768956548ddabe3d2e3 Mon Sep 17 00:00:00 2001 From: Tiago Garcia Date: Fri, 9 Apr 2021 10:48:42 +0200 Subject: [PATCH] Add AWS Xray integration - update XRay daemon URL --- src/app.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app.ts b/src/app.ts index 5be3fe5..5c4aed6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -47,9 +47,6 @@ const init: () => Promise = async (): Promise => { }) })); - // @ts-ignore - app.use(xrayKoa.openSegment('Authentication')); - app.use(flash()); app.use(views(`${__dirname}/views`, { extension: 'ejs' })); @@ -80,6 +77,8 @@ const init: () => Promise = async (): Promise => { } }); + + app.use(RWAPIMicroservice.bootstrap({ name: 'authorization', info: require('../microservice/register.json'), @@ -92,10 +91,14 @@ const init: () => Promise = async (): Promise => { fastlyEnabled: process.env.FASTLY_ENABLED as boolean | 'true' | 'false', fastlyServiceId: process.env.FASTLY_SERVICEID, fastlyAPIKey: process.env.FASTLY_APIKEY - })); app.use(koaLogger()); + + AWSXRay.setDaemonAddress('xray-service.default:2000'); + // @ts-ignore + app.use(xrayKoa.openSegment('Authentication')); + loadRoutes(app); const port: string = process.env.PORT || '9000';