text: var app = require('electron').app;
  var Window = require('electron').BrowserWindow;
  var Tray = require('electron').Tray;
  var Menu = require('electron').Menu;
  var fs = require('fs');
  var path = require('path');
  var url = require('url');
  
  var server = require(path.join(__dirname, 'server.js'));
  
  var mainWindow = null;
  
  app.on('ready', function () {
      'use strict';
  
  
      var iconPath = path.resolve(__dirname, 'static', 'pirate.ico');
      const appIcon = new Tray(iconPath);
      mainWindow = new Window({
          width: 1280,
          height: 1024,
          autoHideMenuBar: false,
          useContentSize: true,
          resizable: true,
          icon: iconPath
          //  'node-integration': false // otherwise various client-side things may break
      });
      appIcon.setToolTip('Pirate AMP');
      mainWindow.loadURL(url.format({
      pathname: path.join(__dirname, 'app.html'),
      protocol: 'file:',
      slashes: true
    }))
    // mainWindow.loadURL('http://localhost:80/');
  
      // remove this for production
      var template = [
          {
              label: 'View',
              submenu: [
                  {
                      label: 'Reload',
                      accelerator: 'CmdOrCtrl+R',
                      click: function(item, focusedWindow) {
                          if (focusedWindow) {
                              focusedWindow.reload();
                          }
                      }
                  },
                  {
                      label: 'Toggle Full Screen',
                      accelerator: (function() {
                          if (process.platform === 'darwin') {
                              return 'Ctrl+Command+F';
                          } else {
                              return 'F11';
                          }
                      })(),
                      click: function(item, focusedWindow) {
                          if (focusedWindow) {
                              focusedWindow.setFullScreen(!focusedWindow.isFullScreen());
                          }
                      }
                  },
                  {
                      label: 'Toggle Developer Tools',
                      accelerator: (function() {
                          if (process.platform === 'darwin') {
                              return 'Alt+Command+I';
                          } else {
                              return 'Ctrl+Shift+I';
                          }
                      })(),
                      click: function(item, focusedWindow) {
                          if (focusedWindow) {
                              focusedWindow.toggleDevTools();
                          }
                      }
                  },
              ]
          }
      ];
  
      var menu = Menu.buildFromTemplate(template);
      Menu.setApplicationMenu(menu);
  
      mainWindow.focus();
  
  });
  
  // shut down all parts to app after windows all closed.
  app.on('window-all-closed', function () {
      'use strict';
      app.quit();
  });
  