Bridge events

This commit is contained in:
Stian Fredrik Aune
2021-05-24 10:31:31 +02:00
parent 883115bf8b
commit a2e719def9
7 changed files with 111 additions and 9 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import React, {useLayoutEffect, useState} from 'react';
import React, {useLayoutEffect, useMemo} from 'react';
// @ts-ignore
import iro from "@jaames/iro";
@@ -11,7 +11,7 @@ interface ColorPickerProps {
const randomId = () => Math.floor(Math.random() * 100000);
export const HSColorPicker: React.FC<ColorPickerProps> = ({h, s, onChange}) => {
const [random] = useState(() => `color-picker-${randomId()}`);
const random = useMemo(() => `color-picker-${randomId()}`, []);
useLayoutEffect(() => {
// @ts-ignore
+8
View File
@@ -0,0 +1,8 @@
const proxy = require("http-proxy-middleware");
let config = {url: "http://127.0.0.1:9000/"};
module.exports = function(app) {
app.use(proxy('/api/ws', { target: config.url, ws: true }));
app.use(proxy('/api', { target: config.url, ws: false }));
};