Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var AWS = XRay.captureAWS(require('aws-sdk'));
var http = XRay.captureHTTPs(require('http'));
const express = require('express');
var bodyParser = require('body-parser');
var queryString = require('querystring');
// Constants
const PORT = 8080;
const apiCNAME = process.env.API_CNAME || 'localhost';
// App
const app = express();
XRay.config([XRay.plugins.EC2Plugin, XRay.plugins.ECSPlugin]);
XRay.middleware.enableDynamicNaming();
app.use(bodyParser.urlencoded({extended: false}));
app.use(XRay.express.openSegment('service-a'));
app.get('/health', function(req, res) {
res.status(200).send("Healthy");
});
app.get('/', function(req, res) {
var seg = XRay.getSegment();
seg.addAnnotation('service', 'service-b-request');
var reqData = queryString.stringify(req.body);
var options = {