diff --git a/.env b/.env index e839907..201b3d9 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -SERVER_PORT = 9000 EO_API_USERNAME = apiclient EO_API_PASSWORD = apiclient12345 EO_API_SCOPE = oidc tags context_entitlements content_entitlements em_api_access diff --git a/Dockerfile b/Dockerfile index 48b1251..bb3b070 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,5 @@ RUN npm ci --only=production # Bundle app source COPY . . -EXPOSE 9000 +EXPOSE 3000 CMD [ "npm", "start" ] \ No newline at end of file diff --git a/index.js b/index.js index a6e7de0..e625cb6 100644 --- a/index.js +++ b/index.js @@ -39,9 +39,9 @@ app.listen(port, () => { // Main Page app.get("/", (req, res) => { res.send({ - message: "FusionAuth Example With Vue", + message: "Engagement Orchestration Services", }); }); //... -app.use("/thread-tracker", require("./routes/threadTracker")); +app.use("/unified-data-gateway", require("./routes/unified-data-gateway")); diff --git a/routes/threadTracker.js b/routes/unified-data-gateway.js similarity index 95% rename from routes/threadTracker.js rename to routes/unified-data-gateway.js index 57438a4..def4efd 100644 --- a/routes/threadTracker.js +++ b/routes/unified-data-gateway.js @@ -33,14 +33,14 @@ router.get("/", (req, res) => { req.session.token = result.data.access_token; console.log(result); //redirect to Vue app - query(req.query.threadId); + query(req.query.referenceId); }) .catch((err) => { console.error(err); }); } - function query(threadId) { + function query(referenceId) { console.log("Executing Query"); var query = `query ($startTime: DateTime, $endTime: DateTime) { @@ -143,8 +143,10 @@ router.get("/", (req, res) => { if (contact.node.interaction.__typename === "Email") { // threadId if Reference in Subject line will do if ( - (contact.node.interaction.threadId === threadId) | - contact.node.interaction.subject.includes(`<< Ref:${threadId} >>`) + (contact.node.interaction.threadId === referenceId) | + contact.node.interaction.subject.includes( + `<< Ref:${referenceId} >>` + ) ) { filteredContacts.push(contact); }