qumra-engine 2.0.69 → 2.0.71
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/dist/middleware.js +8 -4
- package/package.json +1 -1
package/dist/middleware.js
CHANGED
|
@@ -27,7 +27,11 @@ const startEngine = async ({ mode, getRender, setRender, port = 3000, themesRepo
|
|
|
27
27
|
app.use((0, cookie_parser_1.default)());
|
|
28
28
|
app.set("view engine", "nunjucks");
|
|
29
29
|
app.use((0, morgan_1.default)("dev"));
|
|
30
|
-
app.
|
|
30
|
+
app.get("/health", (req, res) => {
|
|
31
|
+
console.log("🚀 Health check OK");
|
|
32
|
+
res.status(200).send("OK");
|
|
33
|
+
return;
|
|
34
|
+
});
|
|
31
35
|
app.use((req, res, next) => {
|
|
32
36
|
const isIframe = req.query.iframe === "1" || req.headers["sec-fetch-dest"] === "iframe";
|
|
33
37
|
if (isIframe) {
|
|
@@ -42,11 +46,11 @@ const startEngine = async ({ mode, getRender, setRender, port = 3000, themesRepo
|
|
|
42
46
|
resave: false,
|
|
43
47
|
saveUninitialized: false,
|
|
44
48
|
cookie: {
|
|
45
|
-
sameSite:
|
|
49
|
+
sameSite: "none", // مطلوب للـ cross-site
|
|
46
50
|
secure: true, // لازم مع 'none'
|
|
47
51
|
httpOnly: true,
|
|
48
52
|
partitioned: true, // علشان تشتغل داخل iframe بعد حجب 3rd-party cookies
|
|
49
|
-
maxAge: 1000 * 60 * 5
|
|
53
|
+
maxAge: 1000 * 60 * 5,
|
|
50
54
|
},
|
|
51
55
|
}));
|
|
52
56
|
app.use((req, res, next) => {
|
|
@@ -69,7 +73,7 @@ const startEngine = async ({ mode, getRender, setRender, port = 3000, themesRepo
|
|
|
69
73
|
if (mode === "devlopment") {
|
|
70
74
|
const staticPath = path_1.default.join(process.cwd(), "assets");
|
|
71
75
|
app.use("/assets", express_1.default.static(staticPath));
|
|
72
|
-
app.use(
|
|
76
|
+
app.use("api", routers_1.default);
|
|
73
77
|
}
|
|
74
78
|
app.use((req, res, next) => {
|
|
75
79
|
if (!(0, isPathAllowedToRender_1.isPathAllowedToRender)(res.locals.parsedUrl.pathname)) {
|