qumra-engine 2.0.14 → 2.0.16
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.
|
@@ -12,8 +12,8 @@ const nunjucksMiddleWare = (req, res, next) => {
|
|
|
12
12
|
console.log("🚀 ~ res:", res.locals.render);
|
|
13
13
|
console.log("🚀 ~ res.locals:", res.locals);
|
|
14
14
|
console.log("🚀 ~ isDev:", isDev);
|
|
15
|
-
console.log("🚀 ~ res.locals.themePath:", res.locals.themePath);
|
|
16
|
-
const mainPath = isDev ? path_1.default.join(process.cwd()) : res.locals.themePath;
|
|
15
|
+
console.log("🚀 ~ res.locals.themePath:", res.locals.render.themePath);
|
|
16
|
+
const mainPath = isDev ? path_1.default.join(process.cwd()) : res.locals.render.themePath;
|
|
17
17
|
const paths = {
|
|
18
18
|
pagesPath: path_1.default.join(mainPath, "pages"),
|
|
19
19
|
layoutsPath: path_1.default.join(mainPath, "layouts"),
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareDataMiddleware = void 0;
|
|
4
|
-
const isPathAllowedToRender_1 = require("../utils/isPathAllowedToRender");
|
|
5
4
|
const prepareDataMiddleware = (req, res, next) => {
|
|
6
|
-
console.log(11111111);
|
|
7
5
|
const parsedUrl = res.locals.parsedUrl;
|
|
8
6
|
// ✅ تخطي الرندر في production لبعض المسارات
|
|
9
|
-
if (res.locals.mode === "production") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
7
|
+
// if (res.locals.mode === "production") {
|
|
8
|
+
// if (isPathAllowedToRender(parsedUrl.pathname)) {
|
|
9
|
+
// console.log("🚀 ~ parsedUrl.pathname:", parsedUrl.pathname)
|
|
10
|
+
// return next();
|
|
11
|
+
// }
|
|
12
|
+
// }
|
|
15
13
|
const api = true
|
|
16
14
|
? "https://store-gate.qumra-dev.site/render"
|
|
17
15
|
: "http://192.168.1.5:4019/v1/render";
|
|
18
|
-
console.log("🚀 ~ api:", api);
|
|
19
16
|
fetch(api, {
|
|
20
17
|
method: "POST",
|
|
21
18
|
headers: { "Content-Type": "application/json" },
|
|
@@ -28,7 +25,6 @@ const prepareDataMiddleware = (req, res, next) => {
|
|
|
28
25
|
return engineResponse.json();
|
|
29
26
|
})
|
|
30
27
|
.then((data) => {
|
|
31
|
-
console.log("🚀 ~ data:", data);
|
|
32
28
|
// تم تخزين النتيجة داخل res.locals.render
|
|
33
29
|
res.locals.render = data;
|
|
34
30
|
console.log("✅ Rendering data prepared");
|