Skip to content

Instantly share code, notes, and snippets.

View phishchiang's full-sized avatar

Phish phishchiang

View GitHub Profile
@phishchiang
phishchiang / App.js
Last active December 24, 2019 10:03
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]);
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) });
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");