qumra-engine 2.0.23 → 2.0.24

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.
@@ -8,16 +8,10 @@ const path_1 = __importDefault(require("path"));
8
8
  const nunjucksEnv_1 = require("../nunjucksEnv");
9
9
  const globals_1 = require("../store/globals");
10
10
  const nunjucksMiddleWare = (req, res, next) => {
11
- console.log(2222222222);
12
11
  const isDev = res.locals.mode === "devlopment";
13
- console.log("🚀 ~ res:", res.locals.render);
14
- console.log("🚀 ~ res.locals:", res.locals);
15
- console.log("🚀 ~ isDev:", isDev);
16
- console.log("🚀 ~ res.locals.themePath:", res.locals.render.themePath);
17
12
  const mainPath = isDev
18
13
  ? path_1.default.join(process.cwd())
19
14
  : path_1.default.join(res.locals.themesRepo, res.locals.render.themePath);
20
- console.log("🚀 ~ mainPath:", mainPath);
21
15
  const paths = {
22
16
  pagesPath: path_1.default.join(mainPath, "pages"),
23
17
  layoutsPath: path_1.default.join(mainPath, "layouts"),
@@ -10,9 +10,13 @@ const prepareDataMiddleware = (req, res, next) => {
10
10
  // return next();
11
11
  // }
12
12
  // }
13
+ let themePath = '';
14
+ if (req.session.themeId) {
15
+ themePath = `?themeVersionId=${req.session.themeId}`;
16
+ }
13
17
  const api = true
14
- ? "https://store-gate.qumra-dev.site/render"
15
- : "http://192.168.1.5:4019/v1/render";
18
+ ? `https://store-gate.qumra-dev.site/render${themePath}`
19
+ : "http://192.168.1.5:4019/v1/render${themePath}";
16
20
  fetch(api, {
17
21
  method: "POST",
18
22
  headers: { "Content-Type": "application/json" },
@@ -26,8 +26,8 @@ const startEngine = async ({ mode, getRender, setRender, port = 3000, themesRepo
26
26
  resave: false,
27
27
  saveUninitialized: false,
28
28
  cookie: {
29
- // لا تضع maxAge أو expires 👇
30
- secure: false, // true لو شغال https
29
+ secure: false,
30
+ maxAge: 1000 * 60 * 5,
31
31
  },
32
32
  }));
33
33
  app.use((req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {