Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports.bind = function (app) {
AWSXRay.enableManualMode()
AWSXRay.setLogger(logger)
AWSXRay.middleware.setSamplingRules('aws-xray.rules')
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
app.use(AWSXRay.express.openSegment('pay_selfservice'))
createNamespace(clsXrayConfig.nameSpaceName)
app.get('/style-guide', (req, res) => response(req, res, 'style_guide'))
// APPLY CORRELATION MIDDLEWARE
app.use('*', correlationIdMiddleware, getRequestContext)
app.use((req, res, next) => {
const namespace = getNamespace(clsXrayConfig.nameSpaceName)
namespace.bindEmitter(req)
namespace.bindEmitter(res)
exports.bind = function (app) {
AWSXRay.enableManualMode()
AWSXRay.setLogger(logger)
AWSXRay.middleware.setSamplingRules('aws-xray.rules')
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
app.use(AWSXRay.express.openSegment('pay_frontend'))
createNamespace(clsXrayConfig.nameSpaceName)
app.use((req, res, next) => {
const namespace = getNamespace(clsXrayConfig.nameSpaceName)
namespace.bindEmitter(req)
namespace.bindEmitter(res)
namespace.run(() => {
next()
})
})