@embeddable.com/sdk-core 2.5.4 → 2.6.0-next.0

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/lib/index.js CHANGED
@@ -20242,6 +20242,7 @@ const buildWebComponent = async (config) => {
20242
20242
  };
20243
20243
  var dev = async () => {
20244
20244
  var _a;
20245
+ checkNodeVersion();
20245
20246
  const http = require("http");
20246
20247
  ora = (await oraP).default;
20247
20248
  process.on("warning", (e) => console.warn(e.stack));
@@ -20270,6 +20271,14 @@ var dev = async () => {
20270
20271
  workspacePreparation.succeed("Workspace is ready");
20271
20272
  const server = http.createServer((request, res) => {
20272
20273
  res.setHeader("Access-Control-Allow-Origin", "*");
20274
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
20275
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
20276
+ if (request.method === "OPTIONS") {
20277
+ // Respond to OPTIONS requests with just the CORS headers and a 200 status code
20278
+ res.writeHead(200);
20279
+ res.end();
20280
+ return;
20281
+ }
20273
20282
  const done = finalhandler(request, res);
20274
20283
  serve(request, res, done);
20275
20284
  });