New config file and update README

This commit is contained in:
Ralex
2024-09-22 14:16:10 +02:00
parent b5abfbb724
commit e775763914
10 changed files with 1099 additions and 476 deletions

View File

@@ -1,10 +1,8 @@
import { createContext, useContext } from "react"
import { io } from "socket.io-client"
import { createContext, useContext, useState } from "react"
import { WEBSOCKET_URL } from "@/constants"
import { WEBSOCKET_PUBLIC_URL } from "../../config.mjs"
export const socket = io(WEBSOCKET_URL, {
path: "/ws/",
//addTrailingSlash: false,
export const socket = io(WEBSOCKET_PUBLIC_URL, {
transports: ["websocket"],
})
@@ -18,7 +16,6 @@ export const SocketContextProvider = ({ children }) => {
export function useSocketContext() {
const context = useContext(SocketContext)
const [isConnected, setIsConnected] = useState(false)
return { socket: context }
}