🔧 Trying out some refactoring on socket connection to Import service
This commit is contained in:
@@ -2,13 +2,12 @@ import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const Navbar: React.FunctionComponent = (props) => {
|
||||
|
||||
return (
|
||||
<nav className="navbar is-fixed-top">
|
||||
<div className="navbar-brand">
|
||||
<a className="navbar-item" href="http://bulma.io">
|
||||
<img
|
||||
src="threetwo.png"
|
||||
src="public/threetwo.png"
|
||||
alt="ThreeTwo! A comic book curator"
|
||||
width="112"
|
||||
height="28"
|
||||
|
||||
@@ -39,6 +39,6 @@ export const IMPORT_SERVICE_BASE_URI = hostURIBuilder({
|
||||
export const SOCKET_BASE_URI = hostURIBuilder({
|
||||
protocol: "ws",
|
||||
host: process.env.DOCKER_HOST || "localhost",
|
||||
port: "8051",
|
||||
port: "3001",
|
||||
apiPath: ``,
|
||||
});
|
||||
|
||||
@@ -9,8 +9,8 @@ const WebSocketContext = createContext(null);
|
||||
export const WebSocketProvider = ({ children }): ReactElement => {
|
||||
const dispatch = useDispatch();
|
||||
const socket: Socket = io(SOCKET_BASE_URI);
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log("connected");
|
||||
dispatch({
|
||||
type: RMQ_SOCKET_CONNECTED,
|
||||
isSocketConnected: true,
|
||||
@@ -35,6 +35,7 @@ export const WebSocketProvider = ({ children }): ReactElement => {
|
||||
console.log(`disconnect`);
|
||||
});
|
||||
|
||||
socket.emit("bastard", { name: "puk" });
|
||||
const ws: any = {
|
||||
socket,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user