qumra-engine 2.0.108 → 2.0.109

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.
@@ -29,11 +29,15 @@ const startEngine = async ({ renderApi, mode, getRender, setRender, port = 3000,
29
29
  app.set("view engine", "nunjucks");
30
30
  app.use((0, morgan_1.default)("dev"));
31
31
  app.use((0, cors_1.default)({
32
- origin: "*", // السماح لأي دومين
33
- methods: "*", // السماح لكل الـ HTTP methods
34
- allowedHeaders: "*", // السماح لكل الـ Headers
32
+ origin: (origin, callback) => {
33
+ callback(null, origin || "*");
34
+ // لو فيه origin بيرجعه، لو مش فيه (زي Postman) بيرجع "*"
35
+ },
36
+ credentials: true, // مهم لو هتستخدم كوكيز أو Authorization
37
+ methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
38
+ allowedHeaders: ["Content-Type", "Authorization"],
35
39
  }));
36
- // السماح لـ preflight requests (OPTIONS)
40
+ // لازم ترد على preflight OPTIONS request
37
41
  app.options("*", (0, cors_1.default)());
38
42
  app.get("/health", (req, res) => {
39
43
  console.log("🚀 Health check OK");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.108",
3
+ "version": "2.0.109",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {