This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Fragment, useState, useEffect, useRef } from "react"; | |
| import socket from "socket.io-client"; | |
| import oscJS from "osc-js"; | |
| import "./App.css"; | |
| function App() { | |
| const [io, setIo] = useState(null); | |
| const [osc, setOsc] = useState(null); | |
| const [msg, setMsg] = useState(""); | |
| const [touchPosi, setTouchPosi] = useState([0, 0]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const socketIO = require("socket.io"); | |
| const path = require("path"); | |
| const cors = require("cors"); | |
| const five = require("johnny-five"); | |
| const board = new five.Board(); | |
| const OSC = require("osc-js"); | |
| const config = { udpClient: { port: 9129, secure: true } }; | |
| const osc = new OSC({ plugin: new OSC.BridgePlugin(config) }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const socketIO = require("socket.io"); | |
| const path = require("path"); | |
| const OSC = require("osc-js"); | |
| const config = { udpClient: { port: 9129, secure: true } }; | |
| const osc = new OSC({ plugin: new OSC.BridgePlugin(config) }); | |
| osc.open(); | |
| const INDEX = path.join(__dirname, "./client/build/index.html"); |