@quintype/framework 7.18.2-webengage.4 → 7.18.2-webengage.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/routes.js +24 -28
package/package.json
CHANGED
package/server/routes.js
CHANGED
|
@@ -312,6 +312,7 @@ exports.isomorphicRoutes = function isomorphicRoutes(
|
|
|
312
312
|
handleNotFound = true,
|
|
313
313
|
redirectRootLevelStories = false,
|
|
314
314
|
mobileApiEnabled = true,
|
|
315
|
+
feEnabled = true,
|
|
315
316
|
mobileConfigFields = {},
|
|
316
317
|
templateOptions = false,
|
|
317
318
|
lightPages = false,
|
|
@@ -333,7 +334,6 @@ exports.isomorphicRoutes = function isomorphicRoutes(
|
|
|
333
334
|
sMaxAge = 900,
|
|
334
335
|
appLoadingPlaceholder = "",
|
|
335
336
|
fcmServerKey = "",
|
|
336
|
-
enableWebengage = false,
|
|
337
337
|
webengageLicenseCode,
|
|
338
338
|
webengageApiKey,
|
|
339
339
|
}
|
|
@@ -430,33 +430,29 @@ exports.isomorphicRoutes = function isomorphicRoutes(
|
|
|
430
430
|
|
|
431
431
|
app.post("/register-fcm-topic", bodyParser.json(), withConfig(registerFCMTopic, { publisherConfig, fcmServerKey }));
|
|
432
432
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
}
|
|
433
|
+
app.post("/webengage-api", bodyParser.json(), async (req, res) => {
|
|
434
|
+
const { headline, subheadline, slug } = req.body;
|
|
435
|
+
console.log("hit /webengage-api", webengageLicenseCode, webengageApiKey, req.body);
|
|
436
|
+
const url = `https://api.webengage.com/v2/accounts/${webengageLicenseCode}/business/save-event`;
|
|
437
|
+
try {
|
|
438
|
+
await request({
|
|
439
|
+
uri: url,
|
|
440
|
+
method: "POST",
|
|
441
|
+
headers: {
|
|
442
|
+
Authorization: `Bearer ${webengageApiKey}`,
|
|
443
|
+
"content-type": "application/json",
|
|
444
|
+
},
|
|
445
|
+
body: { eventName: "story_published", eventData: { author_name: "malibu", story_id: 123 } },
|
|
446
|
+
json: true,
|
|
447
|
+
});
|
|
448
|
+
res.status(200).send("webengage event triggered successfully");
|
|
449
|
+
return;
|
|
450
|
+
} catch (error) {
|
|
451
|
+
console.log("The error is -->", error);
|
|
452
|
+
res.status(500).send("webengage event Failed");
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
460
456
|
|
|
461
457
|
if (manifestFn) {
|
|
462
458
|
app.get("/manifest.json", withConfig(handleManifest, { manifestFn, logError }));
|