Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
running true electron app
Browse files Browse the repository at this point in the history
  • Loading branch information
faaip committed May 26, 2020
1 parent 391516b commit 237c375
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 2 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
const io = require("socket.io")();
const { Client } = require('node-osc');
const client = new Client('127.0.0.1', 8008);
const electron = require("electron");
const proc = require("child_process");
const child = proc.spawn(electron, ["."]);

io.on("connection", (socket) => {
console.log("Socket is connected with Electron App");
socket.on("dispatch", (data) => {
console.log("dispatch: ", data);
// console.log("dispatch: ", data);
for (let i = 0; i < data.landmarks.length; i++) {
client.send('/' + i, data.landmarks[i], () => {
});
Expand All @@ -21,9 +18,4 @@ io.on("connection", (socket) => {
});
});

io.listen(3000);

process.on("exit", () => {
client.close();
child.kill();
});
io.listen(3000);
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { app, BrowserWindow, Menu } = require("electron");
const server = require('./index')


function createWindow() {
Expand Down

0 comments on commit 237c375

Please sign in to comment.