Skip to content

Instantly share code, notes, and snippets.

@theredstapler
Last active July 3, 2018 19:18
Show Gist options
  • Save theredstapler/3a09fb15b424317c10110c0d24d53e44 to your computer and use it in GitHub Desktop.
Save theredstapler/3a09fb15b424317c10110c0d24d53e44 to your computer and use it in GitHub Desktop.
Example code of Electron Hello world Tutorial by Red Stapler. View Tutorial at: https://redstapler.co/tutorials/electron-tutorial/
const electron = require('electron');
const app = electron.app;
const path = require('path');
const url = require('url');
const BrowserWindow = electron.BrowserWindow;
var mainWindow;
app.on('ready',function(){
mainWindow = new BrowserWindow({width: 1024, height: 768,backgroundColor: '#2e2c29'});
//mainWindow.loadURL('https://github.com');
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'test.html'),
protocol: 'file:',
slashes: true
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment