qumra-engine 2.0.73 → 2.0.75
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.
|
@@ -59,9 +59,13 @@ const prepareDataMiddleware = (req, res, next) => {
|
|
|
59
59
|
const expectedHost = typeof backendUrl === "string"
|
|
60
60
|
? new URL(backendUrl).host
|
|
61
61
|
: backendUrl?.host;
|
|
62
|
-
|
|
62
|
+
console.log("🚀 ~ prepareDataMiddleware ~ expectedHost:", expectedHost);
|
|
63
|
+
if (parsedUrl.host !== expectedHost && (expectedHost.includes("localhost"))) {
|
|
63
64
|
//redirect to expected host
|
|
64
|
-
return res.redirect(
|
|
65
|
+
// return res.redirect(
|
|
66
|
+
// 301,
|
|
67
|
+
// `${backendUrl}${parsedUrl.pathname}`
|
|
68
|
+
// );
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
res.locals.render = engineResponse.data?.data;
|
|
@@ -4,6 +4,8 @@ exports.mergeDataMiddleware = void 0;
|
|
|
4
4
|
const globals_1 = require("../store/globals");
|
|
5
5
|
const mergeDataMiddleware = async (req, res, next) => {
|
|
6
6
|
try {
|
|
7
|
+
const templates = res.locals.render.engine?.templates;
|
|
8
|
+
console.log("🚀 ~ mergeDataMiddleware ~ res.locals.render:", templates);
|
|
7
9
|
if (res.locals.preview && res.locals.themeWidget) {
|
|
8
10
|
res.locals.env.addGlobal("widget", res.locals.render.engine?.widget ?? []);
|
|
9
11
|
}
|
|
@@ -33,6 +33,14 @@ export interface MainData {
|
|
|
33
33
|
id: string;
|
|
34
34
|
}>;
|
|
35
35
|
};
|
|
36
|
+
templates: {
|
|
37
|
+
title: string;
|
|
38
|
+
widgets: Array<{
|
|
39
|
+
type: string;
|
|
40
|
+
data: Record<string, any>;
|
|
41
|
+
id: string;
|
|
42
|
+
}>;
|
|
43
|
+
}[];
|
|
36
44
|
settings: Record<string, any>;
|
|
37
45
|
injectionCode: {
|
|
38
46
|
head: string;
|