events work in electron IPC

This commit is contained in:
Jan Prochazka
2021-12-25 10:52:48 +01:00
parent 6dcbb5e308
commit 185cfab5d8
13 changed files with 68 additions and 40 deletions

View File

@@ -90,7 +90,7 @@ function start() {
// Tell the client to retry every 10 seconds if connectivity is lost
res.write('retry: 10000\n\n');
socket.set(res);
socket.setSseResponse(res);
});
app.use(bodyParser.json({ limit: '50mb' }));
@@ -162,4 +162,8 @@ function useAllControllers(app, electron) {
useController(app, electron, '/query-history', queryHistory);
}
module.exports = { start, useAllControllers };
function initializeElectronSender(electronSender) {
socket.setElectronSender(electronSender);
}
module.exports = { start, useAllControllers, initializeElectronSender };