How to use electron-serve - 1 common examples

To help you get started, we’ve selected a few electron-serve 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 codeshifu / clipbot / src / app / app.js View on Github external
tray = null;
  });

  win.on('closed', () => {
    win = null;
    app.quit();
  });
};

const launchOnSystemStartup = (app, launch) => {
  app.setLoginItemSettings({
    openAtLogin: launch
  });
};

const loadURL = serve({ directory: 'build' });

app.on('ready', () => {
  app.dock.hide();
  Menu.setApplicationMenu(Menu.buildFromTemplate([]));

  win = new MainWindow();
  if (process.env.NODE_ENV === 'development') {
    win.loadURL('http://localhost:3000');
  } else {
    loadURL(win);
  }

  bot = new ClipBot(app, win);
  tray = new ClipTray(trayIcon, win, bot);

  bot.watchClipboard(clip => {

electron-serve

Static file serving for Electron apps

MIT
Latest version published 2 months ago

Package Health Score

80 / 100
Full package analysis

Popular electron-serve functions