During initialization you can configure your app,
click here
Properties:
Name |
Type |
Description |
init |
DownstreamElectronBE.init
|
initialize api in main process |
Example
//somewhere in the main process
const { BrowserWindow, app } = require('electron');
const downstreamElectron = require('downstream-electron');
const userSettings = {
"appDir": "/Users/admin/myApp",
"settingsName": "settings",
"publicName": "public",
"downloadsName": "movies"
};
let downstreamInstance;
function createWindow() {
downstreamInstance = downstreamElectron.init(userSettings);
const win = new BrowserWindow({
width: 1200,
height: 700,
resizable: true,
webPreferences: {
plugins: true
}
});
win.loadURL('file://index.html');
win.webContents.openDevTools();
}
function onWillQuit() {
downstreamInstance.stop();
}
app.on('ready', createWindow);
app.on('will-quit', onWillQuit);
app.on('window-all-closed', function () {
console.log("window-all-closed");
app.quit();
});