botserver/src/webapp.ts

29 lines
718 B
TypeScript
Raw Normal View History

2024-08-23 17:23:22 -03:00
import { GBConfigService } from '../packages/core.gbapp/services/GBConfigService.js';
const {app} = (await import('electron')).default;
2024-08-23 00:00:04 -03:00
import path from 'path';
import url from 'url';
2024-08-23 17:23:22 -03:00
export function runUI() {
2024-08-21 15:40:08 -03:00
// Create the browser window.
2024-08-23 17:23:22 -03:00
const win = null;// new BrowserWindow({ width: 800, height: 600, title: 'General Bots Studio' });
2024-08-21 15:40:08 -03:00
2024-08-23 17:23:22 -03:00
import('./app.js').then(gb => {
gb.GBServer.run();
// and load the index.html of the app.
win.loadURL(
url.format({
pathname: path.join(__dirname, `http://localhost:${GBConfigService.get('PORT')}`),
protocol: 'file:',
slashes: true
})
);
});
2024-08-21 15:40:08 -03:00
}
2024-08-23 17:23:22 -03:00
export class GBUI {
static run() {
app.on('ready', runUI);
}
}