Browse Source

remote origin issue solved with electron app

GUI now accessible via http:// and not from file://
using expressjs
ca333-dev
Satinder Grewal 8 years ago
parent
commit
e87713f958
  1. 1
      .gitignore
  2. 19
      main.js
  3. 1
      package.json

1
.gitignore

@ -50,5 +50,6 @@ coins
# Ignore all EasyDEX-GUI subfolder files, except README
EasyDEX-GUI
Iguana-GUI
#EasyDEX-GUI/*
#!EasyDEX-GUI/README

19
main.js

@ -8,6 +8,20 @@ const BrowserWindow = electron.BrowserWindow
var fs = require('fs');
var mkdirp = require('mkdirp');
// GUI APP settings and starting gui on address http://120.0.0.1:77777
var express = require('express')
var guiapp = express()
guiapp.use('/gui', express.static('gui'))
guiapp.get('/', function (req, res) {
res.send('Hello World!')
})
var rungui = guiapp.listen(77777, function () {
console.log('Example guiapp listening on port 77777!')
})
// END GUI App Settings
const path = require('path')
const url = require('url')
@ -52,11 +66,12 @@ function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600})
// load our index.html (i.e. easyDEX GUI)
mainWindow.loadURL(url.format({
mainWindow.loadURL('http://localhost:77777/gui/EasyDEX-GUI/');
/*mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'EasyDEX-GUI/index.html'),
protocol: 'file:',
slashes: true
}))
}))*/
// DEVTOOLS - only for dev purposes - ca333
mainWindow.webContents.openDevTools()

1
package.json

@ -18,6 +18,7 @@
"electron": "^1.4.1"
},
"dependencies": {
"express": "^4.14.0",
"jquery": "^2.2.4",
"mkdirp": "^0.5.1",
"toastr": "^2.1.2"

Loading…
Cancel
Save