How to use the corvid-local-server.startInCloneMode function in corvid-local-server

To help you get started, we’ve selected a few corvid-local-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix-incubator / corvid / packages / corvid-cli / src / utils / electron.js View on Github external
async function connectToLocalServer(serverMode, serverArgs, win) {
  const server =
    serverMode === "edit"
      ? startInEditMode(".", serverArgs)
      : startInCloneMode(".", serverArgs);

  const {
    adminPort: localServerPort,
    adminToken: token,
    close: closeLocalServer
  } = await server;

  win.webContents.on("will-prevent-unload", async event => {
    console.log(JSON.stringify({ event: "closingWithUnsavedChanges" }));
    const choice = process.env.SKIP_UNSAVED_DIALOG
      ? 1
      : await electron.dialog.showMessageBox(win, beforeCloseDialogParams);
    const leave = choice === 0;
    if (leave) {
      event.preventDefault();
    }

corvid-local-server

MIT
Latest version published 3 years ago

Package Health Score

43 / 100
Full package analysis

Similar packages